Basic HTML Document Structure

Basic HTML Document Structure

Every HTML document follows a standard structure to ensure proper rendering.

Key Elements

  • <!DOCTYPE html>: Declares the document as HTML5
  • <html>: Root element
  • <head>: Contains metadata (e.g., <title>, <meta>)
  • <body>: Contains visible content
HTML
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>My Page</title> </head> <body> <h1>Welcome</h1> </body> </html>

Your Task

Create a complete HTML document with:

  1. A DOCTYPE declaration
  2. An HTML element with lang="en"
  3. A meta charset tag
  4. A title "My Webpage"
  5. A heading in the body saying "My Webpage"
AI Learning Assistant

Live Preview