Basic Tags in HTML
Let's have a look at the basic structure of the HTML page.
This is basic structure. Click on MARKUP
<!DOCTYPE html> <html> <head> </head> <body> <p>This is basic structure. Click on MARKUP</p> </body> </html>
Any HTML page consists some basic tags. They should be present in the HTML page.
The following are basic tags:
||This tag defines HTML version. <!DOCTYPE html> means HTML5.|
This tag indicates the starting and ending of the HTML page. Everything that you want your HTML page to show in the browser should be added here.
It is not must though. Any content that is written outside of it also gets rendered.
head means the document's header. It contains the document's metadata ( Data about Data ).
This tag may contain the title of the document ( which will be shown in a browser tab ), meta tags ( tags from which other platforms can know about the page ), CSS and JS file links, etc.
Anything that you want a browser to display will be added here.
As the name suggests, It is document's body.
As you have seen how to structure HTML page. Well, it is not necessary to add these tags. But as a standard HTML page, you should add these basic tags. Then your website and webpage will have a good page ranking.
Let us see an example with just other tags.
Create a file testing.html and add following content.
This is header.
<h1> This is header. </h1>
Open this file in the browser. It will render the file just fine. Now add the basic tags just like below example.
This is header.
<!DOCTYPE html> <html> <head> </head> <body> <h1> This is header. </h1> </body> </html>
Now create a file testing2.html and copy above content and add it. By opening the file in the browser, you will notice that the output is just same as testing.html.
So the browser will not show any error by not providing tags but it will not be good for your page and website if you do not include basic tags. Because without basic tags, search engines like google will not be able to crawl through the page and get information.
So, in this section, you learned about basic tags.
In next section you will learn about heading tags in HTML.