HighDots Forums  

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

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss How do I specify <a href="..." target="_blank">...</a> in XHTML STRICT? in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Tony Marston
 
Posts: n/a

Default How do I specify <a href="..." target="_blank">...</a> in XHTML STRICT? - 08-03-2004 , 10:17 AM






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




Reply With Quote
  #2  
Old   
Johannes Koch
 
Posts: n/a

Default Re: How do I specify <a href="..." target="_blank">...</a> in XHTMLSTRICT? - 08-03-2004 , 10:24 AM






Tony Marston wrote:
Quote:
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.)


Reply With Quote
  #3  
Old   
Steve Pugh
 
Posts: n/a

Default Re: How do I specify <a href="..." target="_blank">...</a> in XHTML STRICT? - 08-03-2004 , 10:30 AM



"Tony Marston" <tony (AT) NOSPAM (DOT) demon.co.uk> wrote:

Quote:
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.

Quote:
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 <steve (AT) pugh (DOT) net> <http://steve.pugh.net/>


Reply With Quote
  #4  
Old   
Spartanicus
 
Posts: n/a

Default Re: How do I specify <a href="..." target="_blank">...</a> in XHTML STRICT? - 08-03-2004 , 10:53 AM



"Tony Marston" <tony (AT) NOSPAM (DOT) demon.co.uk> wrote:

Quote:
The code
a href="..." target="_blank">...</a
Wrong group, crossposted and follow up set to
comp.infosystems.www.authoring.html

Quote:
will not validate as XHTML STRICT because of the 'target' tag
Attribute.

Quote:
, so how do I
achieve the same result by moving it to a CSS file?
CSS is for presentation.

Quote:
I cannot find anything
which allows me to specify 'target=' on an anchor tag.
Good, leave opening new windows/tabs to the user.

--
Spartanicus


Reply With Quote
  #5  
Old   
Jamie
 
Posts: n/a

Default Re: How do I specify <a href="..." target="_blank">...</a> in XHTMLSTRICT? - 08-03-2004 , 01:48 PM





Tony Marston wrote:

Quote:
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


Reply With Quote
  #6  
Old   
David Dorward
 
Posts: n/a

Default Re: How do I specify <a href="..." target="_blank">...</a> in XHTML STRICT? - 08-03-2004 , 04:19 PM



Tony Marston wrote:

Quote:
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


Reply With Quote
  #7  
Old   
Tony Marston
 
Posts: n/a

Default Re: How do I specify <a href="..." target="_blank">...</a> in XHTML STRICT? - 08-03-2004 , 07:28 PM



Thanks. I'll look into it.

--
Tony Marston

http://www.tonymarston.net


"Jamie" <enzymatic2009 (AT) yahoo (DOT) com> wrote

Quote:

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



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.