

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to stretch elements to fit the whole height of the browser window with CSS?
To stretch elements to fit the whole height of the browser window with CSS, the code is as follows −
Example
<!DOCTYPE html> <html> <head> <title>Page Title</title> <style> *{ box-sizing: border-box; } html, body { height: 100%; margin: 0; } .fullHeight{ font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; height: 100%; background: rgb(135, 27, 207); color:white; font-size: 40px; padding: 40px; } </style> </head> <body> <div class="fullHeight">This div element will stretch to the whole height and width of the window</div> </body> </html>
Output
The above code will produce the following output −
- Related Questions & Answers
- How to close the whole browser window by keeping the webDriver active?
- How to make the web page height to fit screen height with HTML?
- How to create a browser window example with CSS?
- How to Make a DIV 100% of the Window Height using CSS
- How to find the inner height and inner width of a browser window in JavaScript?
- Set the font stretch of an element with CSS
- How to set the size of the browser window in Selenium?
- HTML5 Canvas fit to window
- How to avoid the pop-up window in chrome browser with Selenium?
- Set the height of an image with CSS
- Set the height of a box with CSS
- How to Resize Browser Window in WebDriver?
- Width and Height of Elements in CSS
- How to maximize the browser window in Selenium WebDriver using C#?
- Set the height of a line of text with CSS
Advertisements