An HTML document is structured using a series of HTML elements, which are represented by tags. Here is a basic structure of an HTML document:
<!DOCTYPE html> <html> <head> <title>Page Title</title> </head> <body> <header> <!-- header content --> </header> <nav> <!-- navigation links --> </nav> <main> <!-- main content of the page --> </main> <aside> <!-- aside content --> </aside> <footer> <!-- footer content --> </footer> </body> </html>
<!DOCTYPE html> declaration is used to specify the version of HTML being used in the document.
<html> element is the root element of an HTML page and contains all the other elements.
<head> element provides meta information about the document, such as the title of the page, which is displayed in the browser’s title bar or tab.
<body> element contains the main content of the page, including the header, navigation, main content, aside, and footer sections.
<header> element is typically used to contain the header content, such as the logo and site title.
<nav> element is used to contain navigation links.
<main> element is used to contain the main content of the page, such as articles, images, and videos.
<aside> element is used to contain content that is related to the main content but can be considered separate, such as a sidebar.
<footer> element is used to contain the footer content, such as copyrights and links to other pages.