- This topic is empty.
May 29, 2012 at 7:31 am #38257
Is it semantically correct to indicate a new section in your markup simply by using a ‘section’ tag instead of a div or does a section specifically need to be contained within an ‘article’?May 29, 2012 at 7:56 am #103600wolfcry911Participant
Yes, it is semantically correct to use a section element outside of an article. Sections may be part of articles and articles may be part of sections.May 29, 2012 at 8:00 am #103601
So in that sense it can replace a normal div?May 29, 2012 at 9:21 am #103603Taufik NurrohmanParticipant
I saw the site html5doctor,
section‘s are used just like fragment identifiers.
May 29, 2012 at 9:31 am #103604
thanks very much!May 29, 2012 at 10:04 am #103606Paulie_DMember
A ‘section’ element should not be used as a general substitute for a div however. The idea is that a section is a piece (or even a whole group of similar pieces) of content that are “different” from the content next to or around them.
If you have two elements containing ‘news’ then then you should use divs. If you have content for ‘news’ and another for ‘reviews’ then a ‘section’ would be appropriate. That’s not to say that you can’t put divs inside the sections if you want.
A section element by itself does nothing but it does make it an easy way to tell one …ahem…section of your content from another IF you view the code, otherwise you might as well use a div.
HTML5 Doctor, having being referenced says
“Represents a generic document or application section. In this context, a section is a thematic grouping of content, typically with a header, possibly with a footer. Examples include chapters in a book, 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, contact information.”
“With very few exceptions, section should not be used if there is no natural heading for it. “May 29, 2012 at 10:10 am #103609May 29, 2012 at 6:38 pm #103634joshuanhibbertMember
Another way to view it: if it makes sense to add a heading, then you are probably safe using
Also, I use this all the time, and you might find it useful too: http://html5doctor.com/downloads/h5d-sectioning-flowchart.pdf
- The forum ‘Other’ is closed to new topics and replies.