Dragan Peric Dragan Peric - 1 month ago 5
HTML Question

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 wan't to do it with javascript or jquery, how would I do it?

Answer

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

li:nth-of-type(1n+15) {
    display: none;
} 
Comments