Here’s a simple explanation of each line in your HTML boilerplate:
-
<!DOCTYPE html>
This tells the browser that the document is written in HTML5, which is the latest version of HTML. It's like saying, "Hey, this is an HTML document." -
<html lang="en">
This starts the HTML document. Thelang="en"
tells the browser that the content is in English. -
<head>
This is the "head" section of your HTML. It contains information about the webpage (not visible on the page itself), like the title and metadata. -
<meta charset="UTF-8">
This tells the browser how to read the text on your webpage.UTF-8
is a standard that supports most languages and special characters. -
<meta name="viewport" content="width=device-width, initial-scale=1.0">
This makes your webpage look good on all devices, like phones, tablets, or computers. It adjusts the page's size to fit the device's screen. -
<title>Document</title>
This sets the title of your webpage. The title appears on the browser tab or window. You can replace "Document" with the actual title you want. -
<body>
This is where all the visible content of your webpage goes, like text, images, buttons, and more. -
</body>
This ends the body section. -
</html>
This ends the HTML document. It tells the browser, "We’re done with the HTML."
Here’s a simple explanation of the tags inside the <body>
section:
-
<h1>1st heading</h1>
- This is a heading tag.
- It creates a large and bold heading called "1st heading."
h1
is the most important heading, and it is usually used for the main title of the page.
-
<!--Heading tag is usually 6 types from h1 to h6-->
- This is a comment in HTML.
- Comments are notes for developers and do not appear on the webpage.
-
<p>
- This is a paragraph tag.
- It is used to write text content in a block format.
-
<br>
- This is a line break tag.
- It moves the text to a new line without starting a new paragraph.
-
</p>
- This is the closing tag for the paragraph.
- It tells the browser the paragraph content is finished.