Your First HTML Page
Code:
<!DOCTYPE html>
<html>
<head>
<title>My First HTML Page</title>
</head>
<body>
<h1>Hello, world!</h1>
<p>This is my first HTML page.</p>
</body>
</html>
Explanation (Line by Line):
<!DOCTYPE html>
- This line tells the browser that this is an HTML5 document.
- It is placed at the beginning of every HTML page.
- This is the main container of the HTML document.
- All the code is written inside this.
- This section is for background information (which is not visible to the user on the page).
- Things like the page title, CSS links, meta info, etc., go here.
- This sets the title that appears in the browser tab.
- When you open the page, the text you see on the browser tab comes from this.
- This part holds the visible content of the page.
- Everything that the user sees in the browser is written here.
- h1 means Heading 1, which is the biggest heading.
- This displays "Hello, world!" as a bold and large title.
- p stands for paragraph.
- This represents a normal block of text.