Mobile app version of vmapp.org
Login or Join
Courtney195

: 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

@Courtney195

Posted in: #Css

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.

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Courtney195

1 Comments

Sorted by latest first Latest Oldest Best

 

@LarsenBagley505

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.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme