January 17, 201214 yr Hi all. Just been validating a few of my pages for a site that I'm working on and I have the same error on all my pages. I was just wondering if anyone had any tips or advice on resolving it? It's something to do with a jQuery slideshow I have on my site. Here's an example... <!--IMAGE 2--> <a href="limos.html#anchorposition"> <img src="images/slides/2.jpg" alt="Image 2" width="930" height="355" title="Fully loaded 12 seater Mercedes limo bus" rel="Fully loaded 12 seater Mercedes limo bus"/> </a> I've pasted the error below. Line 46, Column 115: there is no attribute "rel" …55" title="Luxurious 8 seater limousines" rel="Luxurious 8 seater limousines"/> ✉ You have used the attribute named above in your document, but the document type you are using does not support that attribute for this element. This error is often caused by incorrect use of the "Strict" document type with a document that uses frames (e.g. you must use the "Transitional" document type to get the "target" attribute), or by using vendor proprietary extensions such as "marginheight" (this is usually fixed by using CSS to achieve the desired effect instead). This error may also result if the element itself is not supported in the document type you are using, as an undefined element will have no supported attributes; in this case, see the element-undefined error message for further information. How to fix: check the spelling and case of the element and attribute, (Remember XHTML is all lower-case) and/or check that they are both allowed in the chosen document type, and/or use CSS instead of this attribute. If you received this error when using the <embed> element to incorporate flash media in a Web page, see the FAQ item on valid flash. Many thanks James Edited January 17, 201214 yr by Renaissance-Design Please use the code button or tags to format your code.
January 17, 201214 yr Delete rel="" for an image src. Always use alt="" and sometimes additionally title="" if you want the text to show as a tooltip in Firefox and some other browsers or for some other purpose but title="" is optional. <a href="limos.html#anchorposition"> <img src="images/slides/2.jpg" alt="Image 2" width="930" height="355" title="Fully loaded 12 seater Mercedes limo bus/> </a> rel is used for stylesheet links in the head section.
January 17, 201214 yr jame5payne, I don't believe I've ever seen the "rel" attribute used to specify text to describe an image. As Wickham suggests, you should be using the "alt" attribute. The "title" attribute is less commonly used than "alt" because the W3C validator tosses a warning at you if you don't have an "alt" attribute but couldn't care less about the "title" attribute. If you do have any Javascript that uses the rel attribute, for example to display a caption with a jQuery script, you would have to leave it in and just ignore the W3C validation message. I remember having to ignore the W3C validation that complained about me placing an H1 tag within an A tag. I had to nest the H1 within the A to make the H1 into a link along with its background image (I used it to display the site logo). It was a popular solution implemented by many web designers and was an alternative to using an IMG tag though, technically, it was improper.
January 17, 201214 yr It's not just for stylesheets, you can use the "rel" attribute for any link. It's used to specify the relationship between the current document and the content you're linking to.
January 17, 201214 yr Author If you do have any Javascript that uses the rel attribute, for example to display a caption with a jQuery script, you would have to leave it in and just ignore the W3C validation message. That's exactly what I'm using it for, a caption for jQuery slider
January 17, 201214 yr There's no reason for the slider to use rel when other attributes exist. Can you hack it?
Create an account or sign in to comment