リスト要素ごとに背景が異なるメニューを作りたい!
/* 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');
}
これは、個々の要素の背景のコードです。このコードで、「li」要素ではなく、リストの各「a」要素の背景を変更したい!