SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Addict aliqayyum's Avatar
    Join Date
    Oct 2009
    Posts
    303
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    how to IMG Tags Open in New Window

    hi friends

    i need your help

    how i can use img tags open in new windows css

    for example i ve post

    http://smashinghub.com/31-best-examp...ogo-design.htm

    if i ve not set target ="_blank" in html code

    i need to by default this option in css

    can any one know this

    thanks

  2. #2
    Mouse catcher silver trophy Stevie D's Avatar
    Join Date
    Mar 2006
    Location
    Yorkshire, UK
    Posts
    5,881
    Mentioned
    122 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by aliqayyum View Post
    how i can use img tags open in new windows css
    You can't. CSS is about presentation and style, not behaviour – opening in a new window is behaviour. You can use either HTML (target="_blank") or Javascript, but not CSS.

    (So I've moved this to a more suitable part of the forum)

  3. #3
    SitePoint Mentor silver trophybronze trophy
    Mikl's Avatar
    Join Date
    Dec 2011
    Location
    Edinburgh, Scotland
    Posts
    1,541
    Mentioned
    63 Post(s)
    Tagged
    0 Thread(s)
    To make target = "_blank" the default for all the hyperlinks on the page, put this line in your page head:

    Code:
    <base target="_blank" />
    Mike

  4. #4
    Non-Member spaculus's Avatar
    Join Date
    Mar 2012
    Location
    Vadodara
    Posts
    13
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by aliqayyum View Post
    hi friends

    i need your help

    how i can use img tags open in new windows css

    for example i ve post

    http://smashinghub.com/31-best-examp...ogo-design.htm

    if i ve not set target ="_blank" in html code

    i need to by default this option in css

    can any one know this

    thanks
    <img class="aligncenter size-full wp-image-25498" title="sports-logos-1" src="http://smashinghub.com/wp-content/uploads/2012/04/sports-logos-1.png" alt="sports-logos-1" width="400" height="400" target="_blank">

    This is the example for the first image. You add the target="_blank" as like this above image tag.

  5. #5
    SitePoint Mentor silver trophybronze trophy
    Mikl's Avatar
    Join Date
    Dec 2011
    Location
    Edinburgh, Scotland
    Posts
    1,541
    Mentioned
    63 Post(s)
    Tagged
    0 Thread(s)
    Aliqayyum, you've had three replies. Were any of them useful to you? I'm asking in case anyone else has the same problem.

    Mike

  6. #6
    SitePoint Wizard bronze trophy Black Max's Avatar
    Join Date
    Apr 2007
    Posts
    4,029
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)
    Question answered and original poster non-responsive. Thread closed.


Bookmarks

Posting Permissions

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