Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Create 100% height of current viewport's height div

Create 100% height of current viewport's height div

Problem

How Can I create a 100% Height div of the current viewport size?

I know there are many resolutions around there, and I want to create a div that is high enough to cover the current size of the viewport.

Suppose the viewport is at the moment the size of one of a 1920x1080 resolution screen, but Also, someone else from a 1024x768 resolution screen wants to view the page, I want the div to be displayed 100% of the height of the viewport it is displayed on.

Is it possible with just css?

Problem courtesy of: codeninja

Solution

give 100% height to html and body, as well as to the div.

Solution courtesy of: underscored

Discussion

View additional discussion.



This post first appeared on CSS3 Recipes - The Solution To All Your Style Problems, please read the originial post: here

Share the post

Create 100% height of current viewport's height div

×

Subscribe to Css3 Recipes - The Solution To All Your Style Problems

Get updates delivered right to your inbox!

Thank you for your subscription

×