SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Enthusiast
    Join Date
    Mar 2013
    Location
    In your browser!
    Posts
    33
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    What's the difference?

    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
    -jonathan

  2. #2
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,295
    Mentioned
    460 Post(s)
    Tagged
    8 Thread(s)
    Quote Originally Posted by AndreeU17 View Post
    Simple question.
    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.

    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?

  3. #3
    SitePoint Wizard Stomme poes's Avatar
    Join Date
    Aug 2007
    Location
    Netherlands
    Posts
    10,283
    Mentioned
    51 Post(s)
    Tagged
    2 Thread(s)
    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).

  4. #4
    SitePoint Enthusiast
    Join Date
    Mar 2013
    Location
    In your browser!
    Posts
    33
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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.
    -Jonathan

  5. #5
    SitePoint Wizard Stomme poes's Avatar
    Join Date
    Aug 2007
    Location
    Netherlands
    Posts
    10,283
    Mentioned
    51 Post(s)
    Tagged
    2 Thread(s)
    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).


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •