M
M
Maxim2020-02-10 19:03:15
css
Maxim, 2020-02-10 19:03:15

How to honor vertical scrollbar in media queries?

It is necessary to make a fixed adaptive layout. Breakpoints are chosen like this, 768px, 1440px. When gradually shrinking the browser window, a horizontal scroll bar appears as you approach a breakpoint. As far as I understand, this is due to the fact that the band pushes the content, compresses it, but the transition point does not take this band into account and the edge of the browser has not yet reached sizes smaller than the transition point.
How to account for vertical scrollbar correctly?
The problem disappears if the transition is done a little earlier, for example at 790px. Because the width of the vertical scrollbar is about 15px.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
tyzberd, 2020-02-10
@mironov_m

You can try it on the mobile, or in the chrome emulator. There the scrollbar has no effect on the width. And by reducing the window, no one checks the adaptive

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question