What is HTML? HTML is the standard language used to create web pages. It provides the structure for a webpage by using tags that tell the browser how to display content like text, images, videos, and links. HTML forms the skeleton of a webpage, allowing us to structure information on the web.
Why is HTML important? HTML is the foundation of all websites. Every webpage we see is built using HTML or a variant of it. It:
Basic Structure of an HTML Document, Here’s a simple HTML document:
<!DOCTYPE html>
<html>
<head>
<title>My First Webpage</title>
</head>
<body>
<h1>Welcome to my webpage</h1>
<p>This is a paragraph of text.</p>
</body>
</html>
<!DOCTYPE html>: Declares the document as an HTML5 document.<html>: The root element that wraps all other elements.<head>: Contains meta-information like the page title and links to external resources (CSS files, JavaScript files).<body>: Contains the actual content that will be displayed on the webpage, like text, images, etc.Common HTML Tags
<h1> to <h6>: Heading tags, with <h1> being the largest and most important.<p>: Paragraph tag for blocks of text.<a>: Anchor tag for links.<img>: Used to display images.