Hayi
Hayi

Reputation: 6236

Make a div full height when scrolling

What is the trick to have a div 100% height always, even if the user is scrolling ?

I try this but it didn't work the height is only applied to the active window.

<body>  
     [...]
     <div class="popup_container">...</div>
</body>

.popup_container {
    position: absolute;
    background-color: rgba(0, 0, 0, 0.65);
    width: 100%;
    min-height: 100%; /** even this didn't work **/
    top: 0;
    left: 0;
    z-index: 12;
}

Upvotes: 0

Views: 350

Answers (1)

Craftein
Craftein

Reputation: 762

.popup_container {
    position: fixed;

Change position to fixed. That should fix your problem ;)

Here's a jsfiddle

Upvotes: 1

Related Questions