![]() |
HTML5-SECTION-TAG |
<section> Tag in HTML5
Introduction of <section> tag
Syntax of <section> tag
Attributes of <section> tag
Introduction of HTML5 <section> Tag
HTML5 <section> tag represents the generic sections of a web application. The section has been used here in the context of a group of such content that is related to the single topic.
For example, a website's homepage can be divided into several sections. As one section can represent complete information about the company, the second section can represent the contact information, the third section can represent the services provided by the company and the fourth section can represent copyright.
All the sections are independent of each other and represent different information. Through the <section> tag, search engines can easily understand your page. Each <section> element is uniquely identified by the heading or child <section> element.
Difference between <section> & <div>
<section> element is not a container element. If you just need a container element in which you can put other elements and design it, then you should use the <div> element.
<div> element does not have any special meaning. <Div> element is skipped by search engines because <div> element is used only to contain other elements.
Every <section> is like a separate page which is identified by search engines. This gives search engines a better sense of a page.
Syntax of <section> Tag HTML5
The general syntax of <section> tag is given below.
<section>
// Heading ...
// Child section element
</section>
Every <section> element has a heading which represents what is information in the section. You can also create another child <section> element in a <section> element.
Attributes of HTML5 <section> Tag
<section> tag supports all global attributes such as id, class etc. Also, this element supports HTML event attributes as well.
How to use section tag in html5?
A full example of the lower <section> element is given below.
In the above example, 5 sections main header, about us, contact us, services, copyright have been created. By doing this, the search engine robot can understand that the page has been divided into 5 parts which are representing different information. This example produces the output below.
0 Comments:
Post a Comment
Thank you for reading this post. Please do not enter any spam link in the comment box.