Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Prevent External Link indicator graphic from displaying on images

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #32432
    rmlumley
    Member

    I’ve added the following bit to my CSS:


    #content a[target^="_blank"] {
    background-image:url(images/extlink.png);
    background-repeat: no-repeat;
    background-position: right;
    padding-right: 12px;
    }

    This gives a little external link indicator (seen on Wikipedia) on all of the links that open in a new window. The issue is it also does this for linked images. Obviously, I don’t want to have that graphic on images. Anyone have an idea on how to get around this?

    In conclusion, I want to use the code above but have it ignore links that are wrapped around images.

    #49627
    AnonymousBlah
    Participant

    try adding this to your css:

    #content img a[target^="_blank"] {
    background-image:url(images/NULL.png);
    background-repeat: no-repeat;
    background-position: right;
    padding-right: 12px;
    }

    If that doesn’t work, create a transparent image, and link it in the place of NULL.png

    #49566
    shazdeh
    Member

    How about this?


    #content a[href$='.png'],
    #content a[href$='.jpg'],
    #content a[href$='.jpeg'],
    #content a[href$='.gif'] {
    background-image: none;
    }

Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘CSS’ is closed to new topics and replies.