
- CSS Tutorial
- CSS - Home
- CSS - Introduction
- CSS - Syntax
- CSS - Inclusion
- CSS - Measurement Units
- CSS - Colors
- CSS - Backgrounds
- CSS - Fonts
- CSS - Text
- CSS - Images
- CSS - Links
- CSS - Tables
- CSS - Borders
- CSS - Margins
- CSS - Lists
- CSS - Padding
- CSS - Cursors
- CSS - Outlines
- CSS - Dimension
- CSS - Scrollbars
- CSS Advanced
- CSS - Visibility
- CSS - Positioning
- CSS - Layers
- CSS - Pseudo Classes
- CSS - Pseudo Elements
- CSS - @ Rules
- CSS - Text Effects
- CSS - Media Types
- CSS - Paged Media
- CSS - Aural Media
- CSS - Printing
- CSS - Layouts
- CSS - Validations
- CSS3 Tutorial
- CSS3 - Tutorial
- CSS3 - Rounded Corner
- CSS3 - Border Images
- CSS3 - Multi Background
- CSS3 - Color
- CSS3 - Gradients
- CSS3 - Shadow
- CSS3 - Text
- CSS3 - Web font
- CSS3 - 2d transform
- CSS3 - 3d transform
- CSS3 - Animation
- CSS3 - Multi columns
- CSS3 - User Interface
- CSS3 - Box Sizing
- CSS Responsive
- CSS - Responsive Web Design
- CSS References
- CSS - Questions and Answers
- CSS - Quick Guide
- CSS - References
- CSS - Color References
- CSS - Web browser References
- CSS - Web safe fonts
- CSS - Units
- CSS - Animation
- CSS Resources
- CSS - Useful Resources
- CSS - Discussion
How to Make a DIV 100% of the Window Height using CSS
The CSS height property helps us specify the height of an element.
Syntax
The syntax of CSS height property is as follows −
Selector { height: /*value*/ }
Example
The following examples illustrate CSS height property.
<!DOCTYPE html> <html> <head> <title>Page Title</title> <style> html, body { margin: 0px; height: 100vh; } div { height: 100%; text-align: center; background: mistyrose; } </style> </head> <body> <div>100% height!!</div> </body> </html>
Example
This gives the following output
<!DOCTYPE html> <html> <head> <title>Page Title</title> <style> html, body { display: flex; flex-direction: row; justify-content: space-around; margin: 0px; height: 100vh; box-shadow: inset 0 0 40px lightblue; } div { width: 40%; height: 100vh; text-align: center; box-shadow: inset 0 0 20px lightcoral; } </style> </head> <body> <div>Watch This!</div> <div>Let Me Show You How The Boss Does It!!</div> <div>Open Up The Sky!!</div> <div>GO! GO! GO!!</div> </body> </html>
This gives the following output
- Related Articles
- How to make the main content div fill height of screen with CSS and HTML
- How to make div elements display inline using CSS?
- How to get the height of a div element using jQuery?
- How to make transition height from 0 to auto using CSS?
- How to stretch elements to fit the whole height of the browser window with CSS?
- Find:$(i).\ 2.7 \div 100$$(ii).\ 0.3 \div 100$$(iii).\ 0.78 \div 100$$(iv).\ 432.6 \div 100$$(v).\ 23.6 \div100$$(vi).\ 98.53 \div 100$
- How to center a <div> using the Flexbox property of CSS?
- How to make a Tkinter window jump to the front?
- Evaluate the following:$[(-100) \div 20] \div [25 \div (-5)]$.
- Making a Div vertically scrollable using CSS
- How to make a fullscreen window with JavaScript?
- How to make a Tkinter window not resizable?
- How can you set the height of an outer div to always be equal to a particular inner div?
- How to auto-resize an image to fit a div container using CSS?
- How to copy the content of a div into another div using jQuery?

Advertisements