469,333 Members | 4,320 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,333 developers. It's quick & easy.

How do I specify <a href="..." target="_blank">...</a> in XHTML STRICT?

The code
<a href="..." target="_blank">...</a>
will not validate as XHTML STRICT because of the 'target' tag, so how do I
achieve the same result by moving it to a CSS file? I cannot find anything
which allows me to specify 'target=' on an anchor tag.

--
Tony Marston

http://www.tonymarston.net

Jul 20 '05 #1
6 77214
Tony Marston wrote:
The code
<a href="..." target="_blank">...</a>
will not validate as XHTML STRICT because of the 'target' tag, so how do I
achieve the same result by moving it to a CSS file?


With CSS you can't. But why not use a Transitional document type if you
want to use deprecated 'features'?
--
Johannes Koch
In te domine speravi; non confundar in aeternum.
(Te Deum, 4th cent.)
Jul 20 '05 #2
"Tony Marston" <to**@NOSPAM.demon.co.uk> wrote:
The code
<a href="..." target="_blank">...</a>
will not validate as XHTML STRICT because of the 'target' tag,
Doesn't validate in HTML 4.01 Strict either.
so how do I
achieve the same result by moving it to a CSS file?


<a href="..." class="whatever">...</a>

a.whatever {target-name: new; target-new: window; target-position:
above;}

But that's CSS3 and isn't supported by anything at the moment, so
instead you either use a Transitional doctype or use JavaScript
instead. Or why not let your visitors choose to open a new window if
they want to, rather than trying to decide for them?

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <st***@pugh.net> <http://steve.pugh.net/>
Jul 20 '05 #3
"Tony Marston" <to**@NOSPAM.demon.co.uk> wrote:
The code
<a href="..." target="_blank">...</a>
Wrong group, crossposted and follow up set to
comp.infosystems.www.authoring.html
will not validate as XHTML STRICT because of the 'target' tag
Attribute.
, so how do I
achieve the same result by moving it to a CSS file?
CSS is for presentation.
I cannot find anything
which allows me to specify 'target=' on an anchor tag.


Good, leave opening new windows/tabs to the user.

--
Spartanicus
Jul 20 '05 #4


Tony Marston wrote:
The code
<a href="..." target="_blank">...</a>
will not validate as XHTML STRICT because of the 'target' tag, so how do I
achieve the same result by moving it to a CSS file? I cannot find anything
which allows me to specify 'target=' on an anchor tag.


Here's how:

http://www.sitepoint.com/article/1041

It requires Javascript, but the code seems pretty simple.

Jamie
Jul 20 '05 #5
Tony Marston wrote:
The code
<a href="..." target="_blank">...</a>
will not validate as XHTML STRICT because of the 'target' tag


Its an attribute, not a tag.

Either:

(1) Don't force new windows on visitors
(2) Use Transitional
(3) Use JavaScript
--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Jul 20 '05 #6
Thanks. I'll look into it.

--
Tony Marston

http://www.tonymarston.net
"Jamie" <en***********@yahoo.com> wrote in message
news:41**************@yahoo.com...


Tony Marston wrote:
The code
<a href="..." target="_blank">...</a>
will not validate as XHTML STRICT because of the 'target' tag, so how do I achieve the same result by moving it to a CSS file? I cannot find anything which allows me to specify 'target=' on an anchor tag.


Here's how:

http://www.sitepoint.com/article/1041

It requires Javascript, but the code seems pretty simple.

Jamie

Jul 20 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Lars Schlanbusch | last post: by
43 posts views Thread by Dimitri Debruyne | last post: by
5 posts views Thread by John A Grandy | last post: by
10 posts views Thread by Gernot Frisch | last post: by
28 posts views Thread by Jim Carlock | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by Marylou17 | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.