Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Limit number of <li> elements in <ol> and <ul>

Is it possible to limit number of li elements in ol and ul directly through html?

If I want to do it with javascript or jquery, how would I do it?

like image 783
Dragan Peric Avatar asked Dec 02 '22 15:12

Dragan Peric


1 Answers

You can do it with CSS 3, if you finally want to hide them.

li:nth-of-type(1n+15) {
    display: none;
} 
like image 89
cralfaro Avatar answered Dec 21 '22 14:12

cralfaro