.visitcard-ipcashier {
position: fixed;
background: white;
top: 0;
right: 0;
height: 95%;
overflow: auto;
z-index: 50;
}
In the above code, i use height atrribute in 93%. But this varies depends on screen. How can i get screen height in css?
To evaluate the screen's length, height, and area, we can follow the same equations as for a flat one: height = diagonal / √(AR²+1) ; length = AR * height ; and. area = height * length .
You can use the window. innerHeight property to get the viewport height, and the window. innerWidth to get its width. let viewportHeight = window.
You can't "get" the viewport height as such, in the way that you can with JS to store it in a variable, but you can use it in calc()
to change the height of elements. For example, height: calc( 100vh - 50px );
which would equate to "the window height less 50px".
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With