HTML

HTML Document Structure


1. Document Structure:

  • <!DOCTYPE html> declares the HTML version as HTML5.
  • <html> is the root element of the HTML document.
  • <head> contains metadata, including the document title.
  • <title> sets the title of the document (displayed in the browser tab).
  • <body> contains the main content of the document.
  • <meta> can be used to provide additional metadata (e.g., character set, viewport settings).
  • <link> can be used to link external resources, such as stylesheets.

 

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Example HTML Document</title>
    <link rel="stylesheet" href="styles.css">
    <meta name="description" content="An example HTML document with metadata.">
</head>
<body>
    <header>
        <h1></h1>
    </header>

    <nav>
        <ul>
            <li><a href="#"></a></li>
            <li><a href="#"></a></li>
            <li><a href="#"></a></li>
        </ul>
    </nav>

    <main>
        <h2></h2>
        <p></p>
    </main>

    <footer>
        <p></p>
    </footer>
</body>
</html>