En ce moment :Genshin Impact, Valhalla, Breath of the wild, Animal Crossing, GTA 5, Red dead 2
PCPS5Xbox SeriesSwitch 2
Liste des sujets
W3C XHTML, problème avec target=""
SideshowBide
Niveau 3
18 août 2008 à 16:29:37
Bonjour à tous.
Le validateur XHTML Strict me boude parce que j'ai mis un attribut target dans une balise <a>
Validation Output: 1 Error
1. Error Line 27, Column 89: there is no attribute "target".
…r.cr/?462311" target="_blank">email</a></td>
✉
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.
Comment remédier à ceci ?
letmeguess
Niveau 5
18 août 2008 à 16:34:33
Tu dois surement avoir une version de Html "Strict" (écrit dans ton doctype). Pour le moment, seul le Html Transitionnal tolère ce genre d'attribut
deepblue
Niveau 16
18 août 2008 à 16:44:41
Remplace ton target par : onclick="window.open(this.href); return false;"
Jujute62
Niveau 9
18 août 2008 à 20:17:39
Juste pour savoir : quelle est l'utilité de l'attribut target dans un lien ?
letmeguess
Niveau 5
18 août 2008 à 20:45:43
C'est pour préciser dans quelle page le document pointé par ton lien va s'ouvrir: la fenêtre actuelle, une nouvelle fenêtre ou, plus utilisé encore tu peux y préciser dans quelle frame, si ton site est structuré en frames.