html - change background of individual list item? -
so im building webpage currently, , request every menu has have different color. im having of struggle figuring out how target individual list item.
heres structure:
<nav> <ul> <li>red</li> <li>blue</li> <li>orange</li> <li>yellow</li> <li>green</li> </ul> </nav>
the items have padding , borderradius can't figure out how give different items different backgroundcolor easiest way.
please me ;)
thanks in advance.
to style nth item, use following css:
li:nth-child(2) { background-color: #f00; /* whatever want */ }
Comments
Post a Comment