section tag vs div

Tag Description

Represents the header of a document or a section. .generalbox h2, #page h2.main, These are grouped together. A perfect example of the use of a div tag is to designate a navigation list: It could be good to realize that span and div are historic. table.categorylist td This one targets td only inside table with class of categorylist. First targets any h2 with class generalbox? You can use a section instead of those divs if you want to give a semantic distinction (like a header, article, e.t.c.) .category .course_info What does this do? The div tag is a block level HTML element.
Represents a section of a document, such as header, footer etc. The HTML
element represents a standalone section — which doesn't have a more specific semantic element to represent it — contained within an HTML document. div.generalbox, div.section These targets a div with class generalbox or section. It is used to divide or section of other HTML tags in to meaningful groups. The Section Element.

Leave a Reply

Your email address will not be published. Required fields are marked *