Forum Moderators: not2easy

Message Too Old, No Replies

preventing an image getting a hover border

         

esllou

10:32 am on Oct 28, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I have a menu cell (id:nav) where all the menu items have a top and bottom border on mouse hover.

#nav A:hover{
border-top:1px solid silver;
border-bottom:1px solid silver;
color: white;
}

now I have added an image into the same cell and given it a class name "nohover"

<a class="nohover" href="http://www.mysite.com/signup.php"><img src="http://www.mysite.com/graphics/image.gif"></a>

and have added this to my css:

#nav A.nohover A:hover{
border-top:none;
border-bottom:none;
}

but it's not changing it. What have I done wrong? I have been looking at this for an hour and I can't see why it isn't being affected by my addition to the style sheet. When I add simply:

#nav A.nohover{
border-top:2px solid blue;
border-bottom:2px solid blue;
}

the image gets a 2px border as expected. It's just the A:hover attribute that isn't working.

any ideas?
}

Robin_reala

10:56 am on Oct 28, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



#nav a.nohover:hover

esllou

11:10 am on Oct 28, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



thanks, you learn something every day.

Robin_reala

11:20 am on Oct 28, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Originally you were specifying a hover on an <a> element that was a child of another <a> element with a class of 'nohover'.