My HTML list looks like this:
<ul>
<li> first element </li>
<li> second element </li>
<li> third element </li>
<li> 4th element </li>
....
</ul>
Using jQuery, I want to set the width of the first <li>
to 10% and distribute the remaining width equally among the other <li>
elements (e.g., 90% divided by number of elements - 5 in this case).
I need to make sure that the <li>
items inside sublists are not affected.
How can I achieve this using jQuery?