HTML Basics Part 9: HTML Main Elements
In this part of the HTML Basics series, I will talk about some of the main HTML elements that every web page needs to have.
Every HTML document (web page) consists of three main elements as shown in the below example. These HTML elements are html, head and body.
In this part, we will briefly explain the role of each element.
HTML documents are defined by the html element.
The page starts with the opening <html> tag and ends with closing </html> tag. All the other elements on the web page are contained within the html element.
If you right click on this page and select "View Page Source", you will notice that the first tag of this page is <html> (after doctype declaration), and the last tag is </html>. Do this on any web page and you will see the same thing.
The head of an HTML document is defined just after the opening <html> tag.
Head element may contain the title of the page, meta information about the page, scripts and styles. Please check the next part of this tutorial, HTML Head, for a more detailed explanation of head element.
Everything you see in your browser window is contained within the body element.
Text, links, images, videos, forms and all such web page elements are defined in the body of the HTML document.
Inside the body, you can define divisions (<div>), paragraphs (<p>), links (<a>), images (<img>) and other HTML elements. You can also insert scripts into the body.
In the next part, I will talk about head element in detail.
More HTML Tips
HTML Basics Part 8: HTML Attributes HTML Basics Part 7: HTML Elements HTML Basics Part 6: HTML Tags HTML Basics Part 5: HTML Syntax HTML Basics Part 4: Getting Started with HTML HTML Basics Part 3: What is HTML (in Detail)? HTML Basics Part 2: The Structure of a Basic Web Page HTML Basics Part 1: Introduction to HTML Publish Your First HTML Website Online Today How to Change HTML Code in Multiple Files at OnceHTML Tips