![]() |
To stretch elements to fit the whole height of the browser window using CSS, you can use “vh” units, where “1vh” equals 1% of the viewport height, so setting the height to “100vh” spans the entire height. Approach: Using CSS height PropertyIn this approach, we are using the Height property to fit the whole height of the browser. The height does not include the margins, padding, or borders. we are setting height to 100% that will cover the whole screen height. Syntax:div { Example: This demonstrates the use of the value of height as 100% so that the element can stretch 100% of the browser window (vertically)
Output: |
Reffered: https://www.geeksforgeeks.org
CSS |
Type: | Geek |
Category: | Coding |
Sub Category: | Tutorial |
Uploaded by: | Admin |
Views: | 29 |