Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 12 of 12
  1. #1
    New Coder
    Join Date
    Feb 2004
    Location
    California
    Posts
    96
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Always _blank in href

    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:
    Code:
    <style type="text/css">
    a:href {
         target:blank;
    }
    </style>
    Thanks.

  • #2
    New Coder
    Join Date
    Dec 2003
    Location
    California
    Posts
    28
    Thanks
    0
    Thanked 0 Times in 0 Posts
    There's no CSS pseudo class called href.

    The following should work (place in your head):

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

  • #3
    Regular Coder
    Join Date
    Jul 2002
    Location
    Kansas, USA
    Posts
    487
    Thanks
    0
    Thanked 54 Times in 53 Posts
    <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)

  • #4
    New Coder
    Join Date
    Dec 2003
    Location
    California
    Posts
    28
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Also, kansel, your code wouldn't validate as the href attribute of the base element is required.

    // freak

  • #5
    New Coder
    Join Date
    Feb 2004
    Location
    California
    Posts
    96
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Yea, I didn't think there was an href sttribute of CSS, was an example

    Thanks for the info.

  • #6
    New Coder
    Join Date
    Dec 2003
    Location
    California
    Posts
    28
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Sorry for being anal, but, it's not an attribute, it's a pseudo-class.

    // freak

  • #7
    New Coder
    Join Date
    Feb 2004
    Location
    California
    Posts
    96
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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*



  • #8
    Senior Coder
    Join Date
    Oct 2003
    Location
    Australia
    Posts
    1,963
    Thanks
    0
    Thanked 0 Times in 0 Posts
    It's not possible in CSS2....But CSS3 will have new found special powers

    I take no responsibility for the above nonsense.


    Left Justified

  • #9
    New Coder
    Join Date
    Feb 2004
    Location
    California
    Posts
    96
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Originally posted by mindlessLemming
    It's not possible in CSS2....But CSS3 will have new found special powers
    OoOooooo....


  • #10
    New Coder
    Join Date
    Mar 2004
    Location
    Helsingborg, Sweden
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts
    "Hyperlink Presentation Module"

    The name alone scares me.

  • #11
    Regular Coder
    Join Date
    Aug 2002
    Location
    Oregon, United States of America
    Posts
    882
    Thanks
    1
    Thanked 9 Times in 9 Posts
    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
    If I'm postin here, I NEED YOUR HELP!!

  • #12
    Regular Coder
    Join Date
    Jul 2002
    Location
    Kansas, USA
    Posts
    487
    Thanks
    0
    Thanked 54 Times in 53 Posts
    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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •