#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2001
    Location
    Sussex, UK
    Posts
    2
    Rep Power
    0

    Problems with font color in css hover classes


    I've setup different css classes for hover, link, active and visited. Each class works unless the font color is specified and different to the body link color.

    In this case, the color remains static in any state and only background color and font-weight will work if used.

    Basically, I have light and dark areas on the page and need links on the dark areas to go white and links on the light areas to go black.

    Apologies if that's a bit vague but would appreciate anyone's help.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2001
    Posts
    266
    Rep Power
    14
    I'm a little unsure about what is happening on you pages. But I will offer a diferent way to go about things.

    Instead of using Classes you could use inline style sheets and see if you get a better result. Otherwise you might want to post you CSS code so people can check for syntax errors.

    E.
  4. #3
  5. No Profile Picture
    Beelzebub
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2001
    Location
    The nether regions...ok, San Diego
    Posts
    164
    Rep Power
    14
    Yeah, that can be tricky. Inline styles won't work if you have defined that "a {color: white}" or whatever. What I do is define "pseudo sub classes"

    Ex:

    a:hover.black {color: black}
    a:hover.white {color: white}

    <a href="..." class=black>...
  6. #4
  7. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2001
    Location
    Sussex, UK
    Posts
    2
    Rep Power
    0
    I created a new page from scratch and the link colors now work!!!??

    The only thing I changed was to re-instate the color for the link state and 'bob was me uncle'. Must've been something in the original pages but I can't imagine what.

    Thanks for your time anyway.
    Last edited by seizure; August 20th, 2001 at 06:42 PM.
  8. #5
  9. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Posts
    1
    Rep Power
    0
    I have problems also with the hover command.

    <!--
    a {font size:13px; color:#804000;}
    a: link {color: #0080FF; font-style normal;}
    a: hover {color:fuchsia; font-weight: bold;}
    a:active {color:green; font-weight: bold;}
    a: visited {color:#800000; font-style: italic;}
    body {background-image: url("../image/bggeese3.jpg"); background-color:#DEDFDE; background-attachment:fixed;}
    -->

    The below works fine on exp 5.5 but not on exp 6

    The colours work ok, the background image works ok on all, its just the hover command that does not work in explorer 6.

    any comments on this code by yourself or others appreciated.

    as sit stands I am drawn to the possibility that ex 6 has a bug. but I hope its me.

    the code shown is called from its own file and applied to pages that are inlining.

    The nettle to grasp here is that 5.5 works just fine.

    Dorothy
  10. #6
  11. No Profile Picture
    Contributing User
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    May 2003
    Posts
    1,014
    Rep Power
    15
    Check your style statements with the W3C CSS Validator. It will show you...

    http://jigsaw.w3.org/css-validator/validator-text.html

    Hope this helps,
    Jeroen

IMN logo majestic logo threadwatch logo seochat tools logo