HTML Document Structure

An HTML document is made up of special keywords called Tags/Markers, written inside <> angle classes. These tags tell the web browser how to display content.

Each HTML document follows a specific structure. Here is what a introduction HTML code looks like:


     <!DOCTYPE html>
      <html lang="en">
      <head>
       <meta charset="UTF-8">
       <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>My First Website</title>
     </head>
     <body>
        <h1>Hello, Coders!</h1>
     </body>
     </html>
     

Let's Understand the Corridors

How the Title is Displayed on an HTML web page

Do not worry if it feels new right now — we'll exercise this again and again until it becomes alternate nature.

An ordinary HTML web page appears as follows:


     <!DOCTYPE html>
     <html lang="en">
       <head>
         <title>web page Title</title>
       </head>
       <body>
         <h1>This is a heading</h1>
         <p>This is a paragraph.</p>
         <p>This is another paragraph.</p>
       </body>
     </html>
         

Nearly all websites follow this format. The primary content is placed within the <body> tag. Do not worry if this seems a bit complex; we'll simplify it!

Keep in mind that these are the crucial factors of a introduce HTML document:

Representation of an HTML Document

There’s a visual definition of the structure of an HTML document:

How This Content Looks in a Web browser

Take a look at this HTML tag:


     <!DOCTYPE html>
     <html lang="en">
       <head>
         <title>My First Website</title>
       </head>
       <body>
         <h1>This is heading.</h1>
         <p>This is paragraph.</p>
       </body>
     </html>
         

The image below illustrates/decod/example how this HTML document will appear when viewed in a web browser:

Browser View of HTML

(This image here showing a browser window with "Document" in the title bar, a heading "This is heading.", and a paragraph "This is paragraph." in the main content area.)

In the web browser, the title bar will show the information from the <title> section, particularly the tag. The primary area of the web browser window, which generally has a white background, will present the content set up within the <body> tag.

In the coming sections, we will explore HTML tag and elements.