Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In what scenarios do you use <section> tag of html 5, in place of <div>?

Tags:

In what scenarios do you use <section> tag of html 5, in place of <div>?

like image 737
Jitendra Vyas Avatar asked May 20 '11 01:05

Jitendra Vyas


People also ask

When should I use section instead of div?

<section> means that the content inside is grouped (i.e. relates to a single theme), and should appear as an entry in an outline of the page. <div> , on the other hand, does not convey any meaning, aside from any found in its class , lang and title attributes.

What is the use of section in html5?

Section tag defines the section of documents such as chapters, headers, footers or any other sections. The section tag divides the content into section and subsections. The section tag is used when requirements of two headers or footers or any other section of documents needed.

Can I use section tag inside div?

Can one use div inside the section block like below? Yes you can use a div inside a section . we use section when we want separate elements (this same category or similar). First tag inside section should be header (h).

Which tag in html5 defines a section in a document?

The <section> tag defines a section in a document.


1 Answers

Examples of sections would be chapters, the various tabbed pages in a tabbed dialog box, or the numbered sections of a thesis. A Web site's home page could be split into sections for an introduction, news items, and contact information

The section element represents a generic document or application section…The section element is not a generic container element. When an element is needed for styling purposes or as a convenience for scripting, authors are encouraged to use the div element instead.

Source.

Further Reading.

Also see When to use the section element.

like image 73
alex Avatar answered Dec 08 '22 23:12

alex