HTML Course | Structure of an HTML Document
The <HTML> is a markup language that is used by the browser to manipulate text, images, and other content to display it in the required format.
Tags in HTML: Tags are one of the most important part in an HTML Document. HTML uses some predefined tags which tells the browser about content display property, that is how to display a particular given content. For Example, to create a paragraph, one must use the paragraph tags(<p> </p>) and to insert an image one must use the img tags(<img />).
There are generally two types of tags in HTML:
- Paired Tags: These tags come in pairs. That is they have both opening(< >) and closing(</ >) tags.
- Empty Tags: These tags do not require to be closed.
Below is an example of (<b>) tag in HTML, which tells the browser to bold the text inside it.
An HTML Document is mainly divided into two parts:
- HEAD: This contains the information about the HTML document. For Example, Title of the page, version of HTML, Meta Data etc.
- BODY: This contains everything you want to display on the Web Page.
Let us now have a look at the basic structure of HTML. That is the code that is a must for every webpage to have:
Every Webpage must contain this code. Below is the complete explanation of each of the tag used in the above piece of HTML code:
<!DOCTYPE html>: This tag is used to tells the HTML version. This currently tells that the version is HTML 5.
<html>: This is called HTML root element and used to wrap all the code.
<head>: Head tag contains metadata, title, page CSS etc. All the HTML elements that can be used inside the <head> element are:
<body>: Body tag is used to enclose all the data which a web page has from texts to links. All the content that you see rendered in the browser is contained within this element.
To learn more about an HTML Document structure, please visit:
Attention reader! Don’t stop learning now. Get hold of all the important HTML concepts with the Web Design for Beginners | HTML course.