Here’s an example of 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> <ul> <li>Item 1</li> <li>Item 2</li> <li>Item 3</li> </ul> </body> </html>
Let’s break down the code:
<!DOCTYPE html>: This is a declaration that tells the browser that this is an HTML5 document.
<html>: This is the root element of the HTML document, which contains all other elements.
<head>: This is where you can include meta information about the document, such as the title that appears in the browser’s tab.
<title>: This is where you specify the title of the webpage.
<body>: This is where you include the content of the webpage that will be displayed to the user.
<h1>: This is a heading element that denotes the main heading of the webpage.
<p>: This is a paragraph element that denotes a block of text.
<ul>: This is an unordered list element that denotes a list of items.
<li>: This is a list item element that denotes an individual item in the list.