View Full Version : Text Underline on hover

Jan 22nd, 2009, 10:45 AM
Hello All,
I dont know why the links dont underline when cursor passes over.
This is the HTML page (http://www.eulconsult.eu/mic/index_n.html)
I'm reffering to both link areas at lines 29 and 49 of the html,
The css defines

text-decoration: underline;
line 27.
Thanks a lot for your help ;-)

Jan 22nd, 2009, 10:53 AM
Do it like this:

#submenu li a:hover,#submenu li a:active

Hope that helps.

Jan 22nd, 2009, 11:05 AM
Thanks bro ;-)

Jan 22nd, 2009, 04:27 PM
I use the forum to learn and I was confused by the answer. So I looked at the page to see why it worked and I'm posting this to 1) make sure I understand it and 2) help anyone else that uses this as a learning aid.

The problem was a:hover with underlining turned on was not turning on the underlining in the menus.

Here is the resulting (and working) code:

#submenu li a:hover, #submenu li a:active {style.css (line 26)
#submenu ul li a {style.css (line 144)
padding:0 10px;

I believe the generic "a:hover" didn't work because the other rule was more specific. The "a" under a specific id (submenu) took precedence over the generic one so no underline appeared. When the generic was made as specific (id submenu was added), then the rule overrode the other one as it appeared after it in the original css.

If I got that wrong, please correct me. If I got it right, it may solve a future problem for someone.