: Is scroll bar included in the browser viewport width? Wondering for CSS purposes if the scroll bar is included in the viewport width? Specifically I'm thinking about calculating the sizes for
Wondering for CSS purposes if the scroll bar is included in the viewport width? Specifically I'm thinking about calculating the sizes for img srcset. For example, would I need to account for it by subtracting like this, where the 17px is the scroll bar:
sizes="(min-width: 38em) calc(50vw-17px), calc(100vw-17px)"
I mean it's not like 17px will make any difference in the image the browser picks, but just wondering.
More posts by @Courtney195
1 Comments
Sorted by latest first Latest Oldest Best
In the case of desktop browsers the scrollbar isnt included in the viewport width, in mobile devices it is as the mobile device scrollbar isnt always there, only visible as a partially transparent interface. The viewport size is based on the area that the web page can actually be displayed in.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.