Answer the question
In order to leave comments, you need to log in
How to style li without class name?
Guys, tell me jsfiddle.net/webirus/3sgwsatq
How to specify styles for li lists correctly so as not to add class="block1" and so on.
To just write li... {background:red:} in CSS.
Is it possible to calculate the number of li in a list in CSS?
Answer the question
In order to leave comments, you need to log in
Use pseudo class nth-child
htmlbook.ru/css/nth-child
in this case
.nav li:nth-child(1) {...}
.nav li:nth-child(2) {...}
.nav li:nth-child(3) {...}
.nav li:nth-child(4) {...}
.nav li:nth-child(5) {...}
assign the .nav class to the ul tag. ..but it's optional if you don't have li anymore, you don't have to add it, but it's better to be safe
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question