Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Invalid HTML5 document - Img rel attribute

  • 25-05-2011 7:26pm
    #1
    Registered Users, Registered Users 2 Posts: 872 ✭✭✭


    Hi,

    I have a simple HTML5 web page that isn't validating when checking on the W3C site.

    The 3 error's are all relating to rel attribute on images :
    Attribute rel not allowed on element img at this point.

    I am using the Nivo Slider for an image gallery and i need to specify the rel attribute of the image for the large version of the image.

    Does anyone have any suggestions on how i can get around this issue ?

    Thanks in advance.


Comments

  • Registered Users, Registered Users 2 Posts: 11,989 ✭✭✭✭Giblet


    Can you update it manually to use a data attribute?


  • Registered Users, Registered Users 2 Posts: 11,989 ✭✭✭✭Giblet


    I just tried it there.
    In the JS file.
    Replace all references to attr('rel') and change them to data('thumb')
    Then change any rel= to data-thumb=

    Then pack the source and import the new JS file into your page.


  • Registered Users, Registered Users 2 Posts: 872 ✭✭✭grahamor


    Thanks Giblet,

    Ill give that suggestion a try.


  • Closed Accounts Posts: 5 tom_odoherty


    This might be a bit of a workaround, rather than a fix, but...

    Is there any way to switch the rel attribute to an anchor tag surrounding the image instead? That would validate, and would also probably result in code that was more semantically accurate.


  • Registered Users, Registered Users 2 Posts: 11,989 ✭✭✭✭Giblet


    That's probably better, if the fallback was a list of thumbs that linked to bigger images (Say, if javascript was disabled).


  • Advertisement
Advertisement