A
A
A person from Kazakhstan2019-01-13 07:01:29
css
A person from Kazakhstan, 2019-01-13 07:01:29

How to get to the last element in a string?

Of course it's flexbox with wrapping
Number of elements unknown
Currently the extremes are : 2 4 8 10
If you add then the layout will change
Is it possible to get to every last element of the row ?
https://codepen.io/topicstarter/pen/bOQyKm here is all the crap
The question I had was born from here

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
RAX7, 2019-01-13
@LenovoId

On js, you can simply compare the offsetLeft of an element with the offsetLeft of the next one, if more, then this is the last one in the line.
Something like this:
https://codepen.io/anon/pen/aPPbGV

P
profesor08, 2019-01-13
@profesor08

Not with state funds. With pens, you type the code in js, which will check how the elements fit by adding their width and comparing it with the width of the container, do not forget to take into account the padding of the elements and the container. All dare, you can even share the result.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question