Different colored square bullet on every navigation item
My site is up at mmp.power1.com. I want to change the menu so that each menu item has a different colored square bullet on it. How do I accomplish that?
.mainnav li {
float: left;
position: relative;
z-index: 999;
height: 20px;
line-height: 20px;
margin-right: 20px;
list-style-image:url(images/square.png);
}
.mainnav li:nth-child(2) {
list-style-image:url(images/square2.png);
} /* etc.. OR */
.mainnav li:nth-child(2n+2) {
list-style-image:url(images/square2.png);
} /* Every second element etc.. */
This is CSS3 so is flakey (flawed?) in IE. Otherwise you could apply class names to the individual li elements and apply image-bullets to the classes.
__________________
"I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.
Validate your HTML and CSS
That's sensible, seeing as we only want squares anyway
I suppose background-image can be used in place of border-color, if an image is required..
__________________
"I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.
Validate your HTML and CSS
Ok, would I have to call the classed within my ul nav? My biggest issue is this whole things in php and Im not sure where the heck the list is.
You can find your list easily by looking at the output source code (view source in browser or using a debugging tool that’s usually built into the browser already). And your menu code looks like this:
And there we see that there are already IDs and classes so you don’t need all these sibling selectors I posted, you can address the elements directly via the IDs.
Yeah, of course you need to assign a border color, otherwise it takes the default text color which is white in this case. If you need a different color for each list item use:
Or use the method with the sibling selectors I demonstrated earlier if you can’t be sure that the IDs will always be like that (e. g. if you add/remove or change the order of pages).
o.o i think i just broke my website... I checked to see if it was the footer doing it, its not, checked the main menu css which i dont think it is, Ive only been tinkering with the main menu css, style css and footer.php.... Im wondering how i broke it.