#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2001
    Location
    Ontario, Canada
    Posts
    56
    Rep Power
    13

    Text color on hover with CSS.


    This is the code I have,
    Code:
    body {
    	color: #000000;	
    }
    
    a:link {
    	color: #000000;
    	text-decoration: none;
    }
    
    a:active {
    	color: #ffffff;
    	text-decoration: none;
    }
    
    a:hover {
    	color: #ffffff;
    	background-color: #000000;
    	text-decoration: none;
    }
    
    a:visited {
    	color: #000000;
    	text-decoration: none;
    }
    
    .left {
    	background-color: white;
    }
    
    .right {
    	background-color: black;
    	color: white;
    }
    I want the text to turn white on hover but it won't.
    Any suggestions?

    http://htp.360viewonline.com
    Massassian

    I did RTFM but I'm a total newb so some of it didn't make sense.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Nov 2001
    Posts
    1,882
    Rep Power
    19
    A:link { color: red } /* unvisited links */
    A:visited { color: blue } /* visited links */
    A:hover { color: yellow } /* user hovers */
    A:active { color: lime } /* active links */

    Note that the A:hover must be placed after the A:link and A:visited rules, since otherwise the cascading rules will hide the 'color' property of the A:hover rule. Similarly, because A:active is placed after A:hover, the active color (lime) will apply when the user both activates and hovers over the A element.
    Try changing the order of your code.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2001
    Location
    Ontario, Canada
    Posts
    56
    Rep Power
    13
    Perfect. Thanks.
    Massassian

    I did RTFM but I'm a total newb so some of it didn't make sense.

IMN logo majestic logo threadwatch logo seochat tools logo