V
V
Vasily Khryagin2020-04-16 10:52:17
css
Vasily Khryagin, 2020-04-16 10:52:17

How can I assign a width based on the number of elements contained in the parent?

Here in ul 2 there is an extra, how to make the width of li 50%. And if there is a surplus of 4, then 25%?

<ul class="slick-dots" style="" role="tablist">
  <li class="" role="presentation">
   <button type="button" role="tab" id="slick-slide-control00" aria-controls="slick-slide00" aria-label="1 of 2" 
   tabindex="-1">1</button>
</li>
 <li role="presentation" class="slick-active">
   <button type="button" role="tab" id="slick-slide-control01" aria-controls="slick-slide04" aria-label="2 of 2" tabindex="-1">2</button>
 </li>
</ul>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
drawnofmymind, 2020-04-16
@drawnofmymind

https://jsfiddle.net/h1cj04yL/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question