Sunday, 18 August 2013

Individual Background for "a" for each list element?

Individual Background for "a" for each list element?

I want to create a menu with diferent backgrounds for each list elements!
/* Adding some background color to the different menu items */
.nav li:nth-child(6n+1) {background: rgb(208, 101, 3);
background-image: url('noise.png');}
.nav li:nth-child(6n+2) {
background: rgb(233, 147, 26);
background-image: url('noise.png');
}
.nav li:nth-child(6n+3) {
background: rgb(22, 145, 190);
background-image: url('noise.png');
}
.nav li:nth-child(6n+4) {
background: rgb(22, 107, 162);
background-image: url('noise.png');
}
.nav li:nth-child(6n+5) {
background: rgb(27, 54, 71);
background-image: url('noise.png');
}
.nav li:nth-child(6n+6) {
background: rgb(21, 40, 54);
background-image: url('noise.png');
}
This is the code for individual element background. I want this code to
change the background for each element for the list not for the
element !

No comments:

Post a Comment