HTML & CSS
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?
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).
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 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:
(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.
@ralph.m: Yeah I'm talking about ARIA roles. Does that change anything about your reply?
@Stomme poes: Purrrr... (;
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.
This topic is now closed. New replies are no longer allowed.