Forum Moderators: open
<a href="http://www.widgets.com" target="_blank">Widgets</a>
But this code does not validate with XHTML 1.0 strict. I get an error message Line 58 column 63: there is no attribute "target". I'm a bit confused, since the documentation on the page [w3.org...] says:
<!--================== The Anchor Element ================================-->
<!-- content is %Inline; except that anchors shouldn't be nested -->
<!ELEMENT a %a.content;>
<!ATTLIST a
%attrs;
%focus;
charset %Charset; #IMPLIED
type %ContentType; #IMPLIED
name NMTOKEN #IMPLIED
href %URI; #IMPLIED
hreflang %LanguageCode; #IMPLIED
rel %LinkTypes; #IMPLIED
rev %LinkTypes; #IMPLIED
shape %Shape; "rect"
coords %Coords; #IMPLIED
target %FrameTarget; #IMPLIED
>
Here, the attribute target is listed as a valid attribute, but I don't know what to make of the gobbledeegook. Is there anywhere I can look up what's allowed or what's allowed instead that simple people can understand? My inbuilt parser just does not read this :(
cheers
teylyn
This issue has been kicked around here for almost three years. For more from me on the topic, check message #8 in this thread: [webmasterworld.com...]
Just for convenience's sake, the Sitepoint article [b]New-Window Links in a Standards-Compliant World[/b] by Kevin Yank has moved to a new place and now can be found at
http://www.sitepoint.com/article/standards-compliant-world
I have not decided which method to use, but right now lean towards Kevin's variety.
cheers
teylyn
The only sensible attitude is to ignore the mindlessly stupid, imbecilic buffons that set the standard and use the target attribute anyway.
... or just use a standard which contains the elements and attributes you require. It is no different than someone saying that they want to use XHTML 1.0 Strict but they want to keep their
<font> tags. I disagree with the approach of the Sitepoint article which gives a rather pointless "solution" to a non-existent problem. If you want to use the
target attribute, why not just use XHTML 1.0 Transitional? Your page will validate just fine without any hacks.