CSS: Are view height (vh) and view width (vw) units widely supported?
use both CSS vh and jQuery, it’s safer. jQuery example: var clientHeight = $( window ).height(); $(‘.element’).css(‘height’, clientHeight); and CSS: .element {height: 100vh;}
use both CSS vh and jQuery, it’s safer. jQuery example: var clientHeight = $( window ).height(); $(‘.element’).css(‘height’, clientHeight); and CSS: .element {height: 100vh;}
One way to do this is with calc. As far as i know, 100% is the width including scrollbars. So if you do: body { width: calc(100vw – (100vw – 100%)); } You get the 100vw minus the width of the scrollbar. You can do this with height as well, if you want a square … Read more
100% can be 100% of the height of anything. For example, if I have a parent div that’s 1000px tall, and a child div that is at 100% height, then that child div could theoretically be much taller than the height of the viewport, or much smaller than the height of the viewport, even though … Read more
Unfortunately this is intentional… This is a well know issue (at least in safari mobile), which is intentional, as it prevents other problems. Benjamin Poulain replied to a webkit bug: This is completely intentional. It took quite a bit of work on our part to achieve this effect. 🙂 The base problem is this: the … Read more