PDA

View Full Version : html validation



yanecek
Feb 9th, 2010, 01:21 PM
Hi there,
I'm having a problem with html validation.
It's says: Attribute


"rel" exists, but can not be used for this element.

…title="madone76" alt="madone69" rel="Antes: 7000 €

Any idea how to solve it ?

Apparently it's a doctype problem. Mine looks like that:


<!DOCTYPE html PUBLIC "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/TR/xhtml1/dtd/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

thanks

Jan

ahallicks
Feb 9th, 2010, 01:26 PM
By the looks of that you have the rel attribute on an image tag? This will not validate because rel can only be applied to specific tags in XHTML.

For clarification:

http://www.w3schools.com/tags/tag_img.asp

Why are you not using a strict doctype? Seems to me, if you're going to use a stricter language you may as well use the strictest form of that language?!

Major Payne
Feb 10th, 2010, 05:54 PM
For info on the "rel" attribute:

Other link relationships (http://www.w3.org/TR/html401/struct/links.html#h-12.1.2)
HTML <a> rel Attribute (http://www.w3schools.com/TAGS/att_a_rel.asp)
Rel attribute (http://en.wikipedia.org/wiki/Rel_attribute)

HTML 5 (RelExtensions) (http://wiki.whatwg.org/wiki/RelExtensions)

DocTypes (http://www.w3.org/QA/2002/04/valid-dtd-list.html). As stated, just as well go for XHTML 1.0 Strict. :P