iambuddylee
03-13-2006, 10:02 PM
Hello, I am an occasional lurker here, but I've decided to register and ask a question to the experts since I am stuck. Here's my situation:
I want to change the background (and text) of a rollover based on css styles.
Here is a snippet of my CSS:
#navcontainer ul
{
padding: .3em 0;
margin: 0;
list-style-type: none;
background-color: rgb(205,219,205);
color: #FFF;
width: 100%;
font: normal 90% arial, helvetica, sans-serif;
text-align: center;
}
#navcontainer li { display: inline; }
#navcontainer li a
{
text-decoration: none;
background-color: #92847B;
color: #FFFFFF;
padding: .3em 1em;
border-right: 1px solid #fff;
border-left: 1px solid #fff;
}
#navcontainer li a:hover
{
background-color: rgb(205,219,205);
color: #000000;
border-right: 1px solid #000;
border-left: 1px solid #000;
}
Using the following code I can change the #navcontainer background colors, but can anyone give advice on how to change the #navcontainer li a:hover background color?
function changeProp(elementId, property, val) {
if (document.getElementsByTagName) {
var element = document.getElementById(elementId);
element.style[property] = val;
}
}
Thank you for any help you can provide!!!
I want to change the background (and text) of a rollover based on css styles.
Here is a snippet of my CSS:
#navcontainer ul
{
padding: .3em 0;
margin: 0;
list-style-type: none;
background-color: rgb(205,219,205);
color: #FFF;
width: 100%;
font: normal 90% arial, helvetica, sans-serif;
text-align: center;
}
#navcontainer li { display: inline; }
#navcontainer li a
{
text-decoration: none;
background-color: #92847B;
color: #FFFFFF;
padding: .3em 1em;
border-right: 1px solid #fff;
border-left: 1px solid #fff;
}
#navcontainer li a:hover
{
background-color: rgb(205,219,205);
color: #000000;
border-right: 1px solid #000;
border-left: 1px solid #000;
}
Using the following code I can change the #navcontainer background colors, but can anyone give advice on how to change the #navcontainer li a:hover background color?
function changeProp(elementId, property, val) {
if (document.getElementsByTagName) {
var element = document.getElementById(elementId);
element.style[property] = val;
}
}
Thank you for any help you can provide!!!