1
If you set the target attribute on a element it won't validate at http://validator.w3.org how doe one come around this and still have it validating?
1
If you set the target attribute on a element it won't validate at http://validator.w3.org how doe one come around this and still have it validating?
1
The target attribute is still part of the HTML 4.01 standard (and works in all browsers), but it is no longer part of XHTML (which you are probably trying to validate for). There is currently no HTML-way to emulate its effect.
There is the CSS3 Hyperlink Presentation Module draft however, that would bring back such a possibility via CSS. However it is currently not implemented by any browser.
XHTML1.0 is semantically the same as HTML4, just expressed as XML instead of SGML. There is (almost) no difference in what elements and attributes are allowed. target
is as valid in XHTML as HTML (that is to say, it can be valid or invalid depending on whether you're using Strict or not). – bobince – 2010-01-08T21:45:17.153
0
You can't use target in valid XHTML.
Here's a way to emulate its effect using valid xhtml with a small snippet of javascript: http://snippets.dzone.com/posts/show/4074
0
<a target>
is perfectly valid in HTML 4.01 Transitional and XHTML 1.0 Transitional. If you must use frame-targetting, you'll need to use one of those DOCTYPEs.
Best to ask at http://doctype.com ?
– Iain – 2010-01-08T13:19:33.170You can have a target element, or you can have valid code. Not both - for a good reason. But if it renders, it renders, right? – Phoshi – 2010-01-08T15:08:02.167