Drezard Posted March 18, 2008 Share Posted March 18, 2008 How come the :hover ending works for: a { ... code } a:hover { ... code } but not for... <style type="text/css"> <!-- .links { color: #000000; font-weight: bold; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; } .links:hover { color: #FFCC00; font-weight: bold; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; } --> </style> [code] Thanks, Daniel [/code] Link to comment https://forums.phpfreaks.com/topic/96695-css-hover-problems/ Share on other sites More sharing options...
GameYin Posted March 18, 2008 Share Posted March 18, 2008 Depends on how you write your HTML. This should work... <style type="text/css"> a .links { color: #000000; font-weight: bold; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; } a .links:hover { color: #FFCC00; font-weight: bold; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; } </style> Enjoy. Link to comment https://forums.phpfreaks.com/topic/96695-css-hover-problems/#findComment-494829 Share on other sites More sharing options...
bronzemonkey Posted March 18, 2008 Share Posted March 18, 2008 It depends what browser you are using. The :hover pseudo-class will only work on anchors in IE6 and below but will work on other elements in modern browsers that better implement the css 2.1 specs Link to comment https://forums.phpfreaks.com/topic/96695-css-hover-problems/#findComment-495333 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.