tomharto
07-25-2011, 09:43 AM
I have this code
<li class="mainMenuLi" onmouseover="showSub(1, 'block', this)" onmouseout="showSub(1, 'none', this)"><a href="/221Print"><span>221 Printing</span></a></li>
I need it so when i hover over the li the LI's background colour changes and the links text colour changes. The background colour changes fine.
#mainMenu li
{
padding:2px;
border:1px solid #de0088;
border-right:none;
width:195px;
background-color:#ffe306;
}
#mainMenu li:hover
{
background-color:#de0088;
color:#FFFF00;
border:1px solid #FFFF00;
border-right:none;
}
Its for a drop down menu and when i try #mainMenu li:hover, #mainMenu a:hover it doesnt work, because when im hovering over a sub menu the mainmenus background color stays changed but the text colour reverts to normal. Does anyone know a way i can get the text colour to stay and the desired hover colour? If i remove the <a>...</a> and just have the text the property 'color:' works, can i make the link colour use the 'color:' preoperty?
<li class="mainMenuLi" onmouseover="showSub(1, 'block', this)" onmouseout="showSub(1, 'none', this)"><a href="/221Print"><span>221 Printing</span></a></li>
I need it so when i hover over the li the LI's background colour changes and the links text colour changes. The background colour changes fine.
#mainMenu li
{
padding:2px;
border:1px solid #de0088;
border-right:none;
width:195px;
background-color:#ffe306;
}
#mainMenu li:hover
{
background-color:#de0088;
color:#FFFF00;
border:1px solid #FFFF00;
border-right:none;
}
Its for a drop down menu and when i try #mainMenu li:hover, #mainMenu a:hover it doesnt work, because when im hovering over a sub menu the mainmenus background color stays changed but the text colour reverts to normal. Does anyone know a way i can get the text colour to stay and the desired hover colour? If i remove the <a>...</a> and just have the text the property 'color:' works, can i make the link colour use the 'color:' preoperty?