1. Home
  2. Docs
  3. Web Technology I
  4. Markup Language (HTML)
  5. Structure of HTML Document

Structure of HTML Document

html basic structure
  1. Document Type Declaration (<!DOCTYPE html>):
    • Specifies the HTML version being used. <!DOCTYPE html> is the declaration for HTML5, the latest version.
  2. HTML Element (<html>):
    • The root element of the HTML document. It wraps all the content on the page.
    • The lang attribute specifies the language of the document (e.g., “en” for English).
  3. Head Element (<head>):
    • Contains metadata about the document, such as character set, viewport settings, and the document title.
    • Meta tags (<meta>) provide additional information about the document.
  4. Charset and Viewport Meta Tags:
    • <meta charset="UTF-8">: Specifies the character encoding for the document (UTF-8 is widely used).
    • <meta name="viewport" content="width=device-width, initial-scale=1.0">: Ensures proper rendering on various devices.
  5. Title Element (<title>):
    • Defines the title of the HTML document, which appears in the browser’s title bar or tab.
  6. Body Element (<body>):
    • Contains the main content of the HTML document, such as text, images, links, and other elements.
    • All visible content is placed inside the <body> tags.
  7. Main Content:
    • Various HTML elements are used to structure and present content within the <body> tags. Examples include headings (<h1>, <h2>), paragraphs (<p>), lists (<ul>, <ol>), images (<img>), and more.
Tags

How can we help?

Leave a Reply

Your email address will not be published. Required fields are marked *