SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Member
    Join Date
    Sep 2010
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question [html5] Would like some feedback regarding my markup

    Hi guys and gals,

    As other I'm in the process of switching to html5! Awesome stuff, but I'm in doubt regarding some markup I'm using at the moment. Because I'm not a professional I would like too ask the pro's what they think of my solution. I have a section with the role of main that wraps around several articles each with the role of article. I don't use the section for styling, it's function is a pure landmark. Is this the correct use of the section element? Note: this is used on a page which list all the blog posts.

    Then I have a single post page. Again, I'm using a section with the role of main that wraps around an article with the role of article. I close this section right after a footer. Then I start a new section for comments. That section has no role. I was wondering is this is correct? Or should the section with the role of main wrapping around the article and comments?

  2. #2
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,297
    Mentioned
    460 Post(s)
    Tagged
    8 Thread(s)
    The new HTML5 elements are mostly designed to do away with roles (are you talking about ARIA roles?). Remember that HTML5 is not yet recognized by browsers, so offers no advantages now ... if it ever will ... and it will change a lot before it's finished (it's only in the very first proposal draft stage right now).

    While it's worth getting to know HTML5, it's not really a good idea to build sites with it (despite what you hear from the Don Quixote evangelists who are riding around on their horses out in the ocean and shaking their HTML5 banners ...) The new HTML5 elements can only breathe right now with the aid of a CSS+JavaScript life support system, which is a ridiculous abuse of all the web standards that have been touted for so many years now.

  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)
    Quote Originally Posted by ralph
    The new HTML5 elements are mostly designed to do away with roles
    On the contrary, roles are becoming native. That is, checkboxes have always been checkboxes but now with an actual default "checkbox" role! But haha, the roles are still being rolled out, so to speak.
    At least some browsers have been able to pass these roles on to AT, which is how we know NVDA had that bug where a nav element with an author-added role of "navigation" tacked on actually announced two navigation roles! It was able to read the one from the plain nav tag.

    @ wollen muts :D lekker warm! But so itchy!

    Bruce Lawson likes to call "main" a "Scooby Do" problem. In Scooby Do, the person who was the monster or ghost was any character in the show who wasn't one of the Gang. To determine if your box makes sense as "main", just check off that it's not:
    header/banner
    navigation/nav
    sidebar/aside/complementary
    footer/contentinfo
    (main chunks of a page)

    Whoever's left, is going to be main. And yeah, even if there are a bunch of separate articles in that box, I think main can be a good role for whatever's wrapping those articles, if it's the main content of that page. You'll have just one main role per page, and it doesn't really matter if inside the articles are more headers and footers and comments and whatnot.

  4. #4
    SitePoint Member
    Join Date
    Sep 2010
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    @ralph.m: Yeah I'm talking about ARIA roles. Does that change anything about your reply?

    @Stomme poes: Purrrr... (;

  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)
    Well, I otherwise agree with Ralph even though ARIA is separate from HTML5 (it started out as an HTML5 project to bring in the "role" idea from XHTML2's XForms, if you've seen those... "aaa:somerole" etc). HTML5 is in draft still, and various parts of it are in various stages of stability. Some of it is pretty stable and safe to use. Some of it only works with Javascript or polyfills. Some of it doesn't work at all. So long as you're aware of what you can use for the audience you're focusing on, you can use what you want of it.

    ARIA, btw, can work fine with HTML4/XHTML1. Sure, the validator complains, but the HTML5 validator.nu recognises ARIA roles and landmarks and they're fine to use regardless. Browsers and AT who don't understand ARIA will just ignore them.


Tags for this Thread

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
  •