HTML Page Structure

DevJunctionPoint
0

 

Understanding the Structure of an HTML Document 

<!DOCTYPE html> // let browser know it's an HTML5 Document.
<html> // Root of an HTML Document
<head> // contains the information of HTML Document.
<title>Page Title</title>
</head>
<body> // Contain everything you want to display on the web page.

<h1>My First Heading</h1>
<p>My first paragraph.</p>

</body>
</html>
  • Almost every website uses this structure. 

Note: These are the essential elements for a basic HTML document: <!DOCTYPE html><html><head><title></head><body></body></html>


DOCTYPE Declaration

<!DOCTYPE html>

  • The <!DOCTYPE html> gives the information to the browser which version of HTML
<html>

  • The <html> tag is the root element.

</html>

  • The </html> tag marks the end of the <html> section.
How does the Browser determine the language of an HTML document?


<html lang="en">

  • the root of an HTML Document specifies language code for element content.
  • The lang attribute specifies the language of the element content

<head>

  • The <head> tag contains metadata and links to external resources like CSS and JavaScript files.

</head>

  • The </head> tag marks the end of the <head> section.

Title Tag

<title>Document</title>

  • The <title> tag sets the title of the web page, which is displayed in the browser's title bar or tab.

Body Tag

<body>

  • The <body> tag contains everything you want to display on the web page

</body>

  • The </body> tag marks the end of the <body> section


How This Content Appears in a Web Browser:


<!DOCTYPE html>
<html lang= "en">
<head>
    <title>Document</title>
</head>
<body>
    <h1> This is a heading</h1>
    <p>This is a paragraph</p>
</body>
</html>

  • Below is an image showing how this HTML document will be rendered in a web browser:

cwh tutorial image


Tags

Post a Comment

0Comments

Do leave your comments

Post a Comment (0)

#buttons=(Ok, Go it!) #days=(20)

Our website uses cookies to enhance your experience. Check Now
Ok, Go it!
To Top