3 ms·
calc(100vw - (100vw - 100%)) Does above not work? https://stackoverflow.com/questions/33606565/is-it-possible-to-calculate-the-viewport-width-vw-without-scrol
by alberth 4y ago
calc(100vw - (100vw - 100%))
Does above not work?
https://stackoverflow.com/questions/33606565/is-it-possible-to-calculate-the-viewport-width-vw-without-scrollbar https://stackoverflow.com/questions/33606565/is-it-possible-...
- chrismorgan 4y agoNo: (a) it only works on elements whose parents are the full viewport width, such as the body (simplifying the rules a little—there’s much finer nuance to the interpretation of percentages), and most of the places you might want viewport units aren’t suitable; and (b) that’s literally just a longwinded way of writing “100%”, because mathematics.
- anamexis 4y agoAs a comment on that answer points out, 100vw - (100vw - 100%) = 100vw - 100vw + 100% = 100%