I\'m having a hard time getting the height of lower screen resolution because my screen resolution is 1920x1080.
Does anyone know how to get height and width of the
Adding to @Hendrik Eichler Answer, the n vh uses n% of the viewport's initial containing block.
.element{
height: 50vh; /* Would mean 50% of Viewport height */
width: 75vw; /* Would mean 75% of Viewport width*/
}
Also, the viewport height is for devices of any resolution, the view port height, width is one of the best ways (similar to css design using % values but basing it on the device's view port height and width)
vh
Equal to 1% of the height of the viewport's initial containing block.
vw
Equal to 1% of the width of the viewport's initial containing block.
vi
Equal to 1% of the size of the initial containing block, in the direction of the root element’s inline axis.
vb
Equal to 1% of the size of the initial containing block, in the direction of the root element’s block axis.
vmin
Equal to the smaller of vw and vh.
vmax
Equal to the larger of vw and vh.
Ref: https://developer.mozilla.org/en-US/docs/Web/CSS/length#Viewport-percentage_lengths