CSS allows to adjust the height of an element using the height property. While there are several units to specify the height of an element. The vh is a relative unit that is commonly used.
vh: It stands for viewport-height. The viewport refers to the browser window size. Thus when use vh as a unit, the element’s height is adjusted relative to the browser window (viewport’s) height.
vw: It stands for viewport-width. It is used to set the browser width 100% relative to the browser window (viewport’s) width.
Syntax: To set a div element height to 100% of the browser window, it can simply use the following property of CSS:
- How to get the size of screen, current web page and browser window using jQuery?
- Window | Window.requestAnimationFrame() Method
- Web Window API | Window menubar property
- Web Window API | Window personalbar property
- Web Window API | Window scrollbars property
- Web Window API | Window locationbar property
- Web Window API | DOM Window fullscreen property
- Web Window API | Window statusbar property
- Web Window API | Window toolbar property
- HTML width/height Attribute vs CSS width/height Property
- How to give text or an image transparent background using CSS?
- How to detect Browser Language in PHP?
- How to open a PDF files in web browser using PHP?
- Difference between Web Browser and Web Server
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.