E
E
Egor Ogurtsov2019-02-27 20:31:20
css
Egor Ogurtsov, 2019-02-27 20:31:20

How to determine if an element has overflow without JS?

There is a block with an indent on the right, sometimes in the content block there is more than it can accommodate and a vertical scrollbar appears, respectively - the width of the block decreases.
Is it possible not to use js at all, but using webkit (a task exclusively for Chrome) to determine the presence of a scrollbar in order to adjust the indent?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Proskurin, 2019-02-27
@Vlad_IT

If purely for chrome, this "crutch" is suitable
the method works if it is known in advance what width the block should be. The right padding is set to the inner block width, the value is the difference between the block width (in absolute value) and the required padding.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question