SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Wizard
    Join Date
    Jan 2005
    Location
    blahblahblah
    Posts
    1,447
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    ARIA: role="article": forced to use a wrapping div?

    Hello,

    I managed to suppress most presentational divs I was using. I'm kinda proud of it, and the mood around those forums has definitely something to do with it.

    Now, I've got a bunch of <p> tags within <div role="main">. Those paragraphs are part of an article. I'd like to use role="article".

    Problem: each <p> would be considered as an article. Saying that the parent div is role="article" wouldn't work: it's already role="main".

    I feel like I have to throw one more div into my mark-up.

    How would you handle it?

  2. #2
    SitePoint Wizard rguy84's Avatar
    Join Date
    Sep 2005
    Location
    Durham, NC
    Posts
    1,659
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    Sample code, screen shot and/or link would help
    Ryan B | My Blog | Twitter

  3. #3
    SitePoint Wizard
    Join Date
    Jan 2005
    Location
    blahblahblah
    Posts
    1,447
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    <div role="main">
    <p>some text</p>
    <p>some text</p>
    <p>some text</p>
    <p>some text</p>
    </div>

  4. #4
    SitePoint Wizard Stomme poes's Avatar
    Join Date
    Aug 2007
    Location
    Netherlands
    Posts
    10,283
    Mentioned
    51 Post(s)
    Tagged
    2 Thread(s)
    If there's only one article on the page, you just need the main role.

    If you're going to use a role of article, that kinda suggests there are many on the page.

    Similar to using the article HTML5 tag.

    Also, elements may have more than one role so long as they do not interfere with each other.


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
  •