Skip to content Skip to sidebar Skip to footer

How Can I Make A Div Height Automatically Fit Screen And Expands If The Content Exceeds Height

On my web page I have a div that expands(height) to fit the size of the screen. Here is my CSS: .round-cornerapp { -webkit-border-radius: 5px 5px 5px 5px; -moz-border-

Solution 1:

Use jQuery more specifically, the $(document).height() function.

$('.divFullScreen').height($(document).height());

Otherwise, you could also use CSS as follows.

.divFullScreen {
    min-height: 100vh;
}

PS: your div's class should be divFullScreen for this to work.

Post a Comment for "How Can I Make A Div Height Automatically Fit Screen And Expands If The Content Exceeds Height"