Basic Structure of HTML
A simple HTML document looks like this:
<!DOCTYPE html>
<html>
<head>
<title>My First Webpage</title>
</head>
<body>
<h1>Welcome to My Website</h1>
<p>This is a simple HTML page.</p>
</body>
</html>
Explanation of HTML Structure
Tag | Description |
---|---|
<!DOCTYPE html> | Declares the document as HTML5. |
<html > | The root element of an HTML page. |
<head> | Contains metadata, links to stylesheets, and scripts. |
<title> | Sets the title of the page (shown in the browser tab). |
<body> | Contains all visible content (headings, paragraphs, images, links, etc.). |