4 ms·
To set an element height to the full viewport height, you can use `height: 100vh`. That unit is available since 2011. Please do your homework.
by juandazapata 11y ago
To set an element height to the full viewport height, you can use `height: 100vh`. That unit is available since 2011. Please do your homework.
- prezjordan 11y agoNo need to be pedantic, onion2k's original point that you can use values from the browser is spot-on. If you've ever tried to interact with CSS transitions/animations with JavaScript you'll find rather quickly that doing the entire thing in JS is the only reasonable approach.
- majewsky 11y agoOkay, but then, since you're already animating individual elements, what's the benefit over jQuery's $.fn.css?
- onion2k 11y agoI didn't mean the viewport. I meant the page eg the full height of the rendered window content including everything outside of the viewport's scroll region.