apply a style to ALL links EXCEPT...

Discussion in 'CSS' started by belledumonde, Sep 5, 2006.

  1. #1
    i have this css declaration:

    a:active { 
       position: relative; 
       right: -1px; 
       bottom: -1px;
       }
    Code (markup):
    and i want it to apply to ALL links EXCEPT a img UNLESS the link has a class of "image".

    this is because i'm using lightbox, and when the corner [ x ] is clicked on to close, it keeps moving and it won't close so you're stuck in the lightbox. i was thinking of making the [ x ] bigger but that ruins the image. then i tried applying different position declarations on a.image but that didn't work, i was thinking of selecting each link by contextual selectors except a.image but that just bloats my CSS.

    so can this be accomplished with cross-browser compatible CSS or would it be more efficient to use a very short JS script??

    help is much appreciated! :)
     
    belledumonde, Sep 5, 2006 IP
  2. avik

    avik Guest

    Messages:
    161
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #2
    .image a:active {your code}

    hope this'll help.
     
    avik, Sep 5, 2006 IP
    iceberg likes this.
  3. hexed

    hexed Peon

    Messages:
    333
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Actually you forgot the comma.


    .image, a:active {your code}

    Hexed
     
    hexed, Sep 6, 2006 IP
  4. sketch

    sketch Well-Known Member

    Messages:
    898
    Likes Received:
    26
    Best Answers:
    0
    Trophy Points:
    148
    #4
    Uh, no, the comma doesn't belong there. Avik created a substyle to the .image class... placing a comma like hexed did is creating two separate styles.
     
    sketch, Sep 6, 2006 IP