andreeu17 — 2013-03-28T00:03:35-04:00 — #1
Simple question. What's the difference between an <article> and a <section> semantic?
What's they're main purpose ? Is it worth my time to use? Are they important or can I continue using divs ?
Any info is well appreciated thanks
ralphm — 2013-03-28T01:02:49-04:00 — #2
Simple? Don't be so sure. Plumbing the meaning of some of these new HTML elements seems to rival the big questions of Life sometimes. :rolleyes:
A <section> is for grouping related content, more commonly large sections of a page like a main content area. An <article> is more specialized, being for self-contained content—that is, content that could appear somewhere else and retain its meaning. A blog post, for example, could be posted elsewhere (in an RSS feed, for example) and still be meaningful without the original page context.
So should you use them? Don't feel obliged to. IMHO, they are silly elements, and I don't know if I'll ever use them. I don't believe there's any advantage to be had by using them at this point in time, at any rate ... except perhaps to make yourself feel all hip—which is, after all, the point of living ... isn't it?
stomme_poes — 2013-03-28T03:39:51-04:00 — #3
Structure-wise, originally it was to mean an <article> would/could be like a mini-document or mini-page: a header, a footer, possibly asides and main content.
<section> was more broad, however due to sectionitis (a painful variant of divitis, and apologies to others medically educated for the horrid terminology) there's been some talk recently of stating something like, you shouldn't (or can't) make something a section unless the first bit of content in it is a header or heading (<h?> tag)... though someone brought up that ajax dynamically injecting content could make this a difficult hard rule.
But anyway that's something you could use as a rule of thumb... take what ralph said
An <article> is more specialized, being for self-contained content—that is, content that could appear somewhere else and retain its meaning.
and then use sparingly, and for sections ask yourself why it shouldn't be a div, and does it group a large chunk of content which starts with a <header> or heading <h?>? (even then, keep sections scarce and large, and use divs for all your little groupings you're doing for CSS, JS, etc).
andreeu17 — 2013-03-28T10:11:26-04:00 — #4
Thank you both for the very well response, in my opinion I dislike the section and article semantics. I have a very found approach to the divs. i think I'll just stick with the divs until the day I really need section or article or until other day they become well developed and meaningful. Thank you for your responses.
stomme_poes — 2013-03-29T15:36:51-04:00 — #5
You certainly aren't hurting yourself by sticking to divs. Currently the only semantics you actually get from those is, sections are "sectioning elements" of the HTML5 document outline, implemented badly by the JAWS screen reader and not much else (it'll announce each new section).