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
- The
<!DOCTYPE html>
gives the information to the browser which version of HTML
- The
<html>
tag is the root element.
- 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
- The
<head>
tag contains metadata and links to external resources like CSS and JavaScript files.
- The
</head>
tag marks the end of the<head>
section.
Title Tag
- The
<title>
tag sets the title of the web page, which is displayed in the browser's title bar or tab.
Body Tag
- The
<body>
tag contains everything you want to display on the web page
- The
</body>
tag marks the end of the <body> section
How This Content Appears in a Web Browser:
- Below is an image showing how this HTML document will be rendered in a web browser:
0 Comments:
Post a Comment
Do leave your comments