Two Questions.

anna

New Member
For the buttons to change color you need to utilize the pseudo class selectors, for instance:

ul#navlist li a
{
color: #ffffff;
background-color: #003366;
padding: 3px;
border: 1px #ffffff outset;
}

ul#navlist li a:hover
{
color: #ffff00;
background-color: #003366;
}

ul#navlist li a:active
{
color: #cccccc;
background-color: #003366;
border: 1px #ffffff inset;
}



Second
For the text to move over, use padding:
#container {
padding: 5px;
}

Obviously adjust as necessary. I hope this helps, I am still quite new at CSS!!
 

PixelPusher

Super Moderator
Staff member
DJM,

Anna is 99% correct (good job :D).
Only minor thing I would correct is you don't need to add the background-color to the hover and active states if it is going to be the same as the original (static) style.

Rule of thumb, after creating a style for element, only add the items you want to change in the hover, active, visited, focus states.

Padding - adds spacing to the internal area of an element.
Margin - adds spacing to the external area of an element.

Anchor Style

Code:
ul#navlist li a
{
color: #ffffff;
background-color: #003366;
padding: 3px;
border: 1px #ffffff solid;
}

ul#navlist li a:hover
{
color: #ffff00;
}

ul#navlist li a:active
{
color: #cccccc;
}
 

anna

New Member
Yea!! I got it almost right!!! :D

I think for just a rollover change, you would add the hover selector and leave the active off. Is that correct Pixel?
 
Top