My screen resolution is 2560 x 1440. If I want a divs height to be (for example) 10% of my vertical screen resolution (144px) how would I do this?
I'm guessing this must be done with javascript...?
EDIT:
vw
and vh
are not what I need.
I need the entire screen resolution of my computer not of just the browser window which is what vw
and vh
do.
The question this post is similar to does indeed show users how to detect screen resolution, BUT not specifically how to use that screen resolution to modify a div in CSS.
Figured it out on my own...
<script>
document.getElementById("div").style.height = screen.height + "px";
</script>