Results 1 to 5 of 5

Thread: CSS A:hover...

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Jul 1999
    Posts
    5,923

    CSS A:hover...

    I'm using this code to apply a background colour to hyperlinks when the mouse moves over them.
    Code:
    A:hover {
        text-decoration : none;
        color : #0080C0;
        background-color : #DEDFDF;
    }
    However it also colours the background of image links. How can I get it to only apply to text links?

    Thanks

  2. #2
    Black Cat JoshT's Avatar
    Join Date
    Nov 2000
    Location
    WNY, USA
    Posts
    4,032
    CSS:

    A.ClassName:hover { }

    HTML:

    <a class="ClassName">

    So you can control the specific tags you want. Just remember that A.ClassName will inherit from the generic A.
    Josh
    Get these: Mozilla Opera OpenBSD
    I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.

  3. #3

    Thread Starter
    PowerPoster
    Join Date
    Jul 1999
    Posts
    5,923
    ah! cheers

    Anybody know what happens if a non css compliant browser views the anchor html with a class attr.? Does it screw up?

  4. #4
    Hyperactive Member
    Join Date
    Aug 2001
    Location
    India
    Posts
    276

    Another work-around

    However it also colours the background of image links. How can I get it to only apply to text links?
    Try marking border=0 for the images... then it won't apply, i think.

    - Jemima.

  5. #5
    Fanatic Member ubunreal69's Avatar
    Join Date
    Apr 2001
    Location
    Morayfield, Australia
    Posts
    609
    hmmm, i meant to post a thread posing exactly the same problem a while ago, this is so cool (not really) anyway, thanx ppl.

Posting Permissions

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



Click Here to Expand Forum to Full Width