...

View Full Version : Always _blank in href



Steveo31
03-01-2004, 08:51 PM
I did a search, couldn't find anything I needed..

I assume there is a way to make ALL links in the page to target a _blank. I thought it might be something like:


<style type="text/css">
a:href {
target:blank;
}
</style>


Thanks.

freak
03-01-2004, 10:06 PM
There's no CSS pseudo class called href.

The following should work (place in your head):



<base href="http://url.of.site" target="blank" />


Though, I would highly suggest that you not make the decision for the user as to where links open.

// freak

kansel
03-01-2004, 10:07 PM
<base target="_blank">
though I really would avoid using this since it's meant for frames and not just to pop open new windows.

(this code goes in the head if you do use it)

freak
03-01-2004, 10:08 PM
Also, kansel, your code wouldn't validate as the href attribute of the base element is required.

// freak

Steveo31
03-01-2004, 11:31 PM
Yea, I didn't think there was an href sttribute of CSS, was an example :)

Thanks for the info.

freak
03-02-2004, 12:44 AM
Sorry for being anal, but, it's not an attribute, it's a pseudo-class.

// freak

Steveo31
03-03-2004, 05:57 AM
Originally posted by freak
Sorry for being anal, but, it's not an attribute, it's a pseudo-class.

// freak
Oh.. sorry. *bows down sarcastically*


;) :D

mindlessLemming
03-03-2004, 06:33 AM
It's not possible in CSS2....But CSS3 will have new found special powers (http://www.w3.org/TR/2004/WD-css3-hyperlinks-20040224/) :D

Steveo31
03-03-2004, 07:13 AM
Originally posted by mindlessLemming
It's not possible in CSS2....But CSS3 will have new found special powers (http://www.w3.org/TR/2004/WD-css3-hyperlinks-20040224/) :D
OoOooooo....

:thumbsup: :cool:

jdan
03-05-2004, 12:23 PM
"Hyperlink Presentation Module"

The name alone scares me. :)

Ultragames
03-05-2004, 05:57 PM
Im preaty sure there is an XML code to do this, but im not sure.

Why do you want to use _blank anyways? If you want a new window, use a target of _window or _new. If you want it to pop out of your frames, use a target of _top

Just my 2cents.


CSS3 Ooooooo

kansel
03-05-2004, 07:08 PM
Because _blank is a reserved target that will open a new unnamed window.

The reserved targets are _blank, _parent, _self, and _top. Any other value for target will open a window with that value as the window's name. If a window with that name already exists, it will use that window instead of opening a new window. _blank is the only way to guarantee that a new window is opened.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum