Target tag

admin

Administrator
Staff member
For my page to be valid xhtml i'm not allowed to use target="_blank" in my <a> tag.<br />
<br />
<a href=http://www.webdeveloper.com/forum/archive/index.php/"blah.php" title="Blah" target="_blank"> Blah</a><br />
<br />
What can I use instead that is xhtml valid?<br />
<br />
Cheers!<!--content-->http://www.alistapart.com/articles/popuplinks/<!--content-->Yes you are allowed to use target="_blank" in XHTML 1.0 I don't know where you got the strange idea you couldn't.<br />
<br />
Unless of course you are using XHTML 1.1 in which case you should serve it as XML not text/html.<!--content-->From W3..<br />
<br />
<!-- m --><a class="postlink" href="http://validator.w3.org/check?uri=http%3A%2F%2Fgavinpearce.co.uk%2Fportfolio.htm">http://validator.w3.org/check?uri=http% ... tfolio.htm</a><!-- m --><br />
<br />
--------------------<br />
<br />
Line 21, column 61: there is no attribute "target" <br />
<br />
.../www.dec25.net" title="Dec25" target=" _blank">www.dec25.net</a><br /><em>A ch...<!--content-->Because you used Strict DTD, why though? <br />
<br />
Since you served it as 'text/html' instead of the recommended 'application/xhtml+xml'. You gain little benefit of using Strict unless you serve as 'application/xhtml+xml'. Don't feel obligated to answer my rhetorical question but there is no major benefit of Strict over Transitional when served as 'text/html' tag soup.<!--content-->What would be the benefit of serving it as 'application/xhtml+xml' over 'text/html'?<br />
<br />
If I kept with strict, would I be forced into using JS to have the window open?<!--content-->Yes, you would be forced to use JavaScript if you chose Strict unless you added eXtensibility and re-wrote target back into the DTD. <br />
<br />
As you are aware XHTML is XML and not HTML thus theoretically it is supposed to be served as XML to be used by XML-Processors which do not accept erroneous syntax, for example Mozilla Firefox.<br />
<br />
Most of the benefits you won't realise because only Opera 7.2x and Mozilla 1.x can understand XHTML in it's native format - on the Windows Platform.<br />
<br />
If you are into boring stuff: <!-- m --><a class="postlink" href="http://www.hixie.ch/advocacy/xhtml">http://www.hixie.ch/advocacy/xhtml</a><!-- m --><!--content-->
 
Back
Top