HighDots Forums  

Can this be done?

Macromedia Dreamweaver Macromedia Dreamweaver Discussions (macromedia.dreamweaver)


Discuss Can this be done? in the Macromedia Dreamweaver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Mark Morse
 
Posts: n/a

Default Can this be done? - 08-03-2004 , 03:15 PM






Is there a way using only css to force all links on a page to open in a new
window?

a {target: new;} doesn't work. I'm working on an app where I can't get
directly to the "a" tags but I can get to the stylesheet to redefine the "a"
tag.

Thanks
mark


Reply With Quote
  #2  
Old   
cmbergin
 
Posts: n/a

Default Re: Can this be done? - 08-03-2004 , 03:50 PM






CSS is for presentation only, so I don't think you can set the link target with
CSS. I'm pretty sure :target is a pseudo-class, but I wouldn't know how to use
it.

This shouldn't work, but does in IE. Won't work anywhere else because only IE
recognizes "expression".
a {
target:expression(this.target='_blank');
}


Reply With Quote
  #3  
Old   
~Angela, TMM
 
Posts: n/a

Default Re: Can this be done? - 08-03-2004 , 03:51 PM



Hi Mark,

There's no way I know of with CSS, but you could probably do it with some
JavaScript. The first possible solution that comes to mind is getting an
array of all <a> tags as objects. Then you'd loop through them, setting the
target attribute to _blank.

Hoop that's enough to get you started! Good luck...

~Angela

--
Angela C. Buraglia, Founder:
~FAQs, Tutorials & Resources~ http://www.DreamweaverFAQ.com
~My Extensions~ http://www.dwfaq.com/go.asp?ID=AngelaX10
DWfaq Support Newsgroup: news://support.dwfaq.com/support

Co-Author with Joseph Lowery, Dreamweaver MX 2004 Killer Tips:
http://www.dwkillertips.com

Extension Developer for Cartweaver 2:
http://www.cartweaver.com/features/extensionsuite/

Remove the CAPS in my E-mail to reply off list.



"Mark Morse" <mark.morse (AT) sanmina-sci (DOT) com> wrote

Quote:
Is there a way using only css to force all links on a page to open in a
new
window?

a {target: new;} doesn't work. I'm working on an app where I can't get
directly to the "a" tags but I can get to the stylesheet to redefine the
"a"
tag.

Thanks
mark




Reply With Quote
  #4  
Old   
Michael Fesser
 
Posts: n/a

Default Re: Can this be done? - 08-03-2004 , 07:11 PM



.oO(cmbergin)

Quote:
CSS is for presentation only, so I don't think you can set the link target with
CSS. I'm pretty sure :target is a pseudo-class, but I wouldn't know how to use
it.
:target is a pseudo-class in CSS3, but that's not what the OP wants.

6.6.2 The target pseudo-class :target
http://www.w3.org/TR/2001/CR-css3-selectors-20011113/#target-pseudo

Micha


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.