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

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -