Scrumplex
Scrumplex

Reputation: 542

Set div's minimum height

I wanted to ask how I can define a div's minimum height in css.

For example if I am on a small screen and the line break has changed, the div should be automatically resized, but it should be at least 100%.

Upvotes: 2

Views: 1399

Answers (1)

AndrewL64
AndrewL64

Reputation: 16341

Just use min-height to keep the div height 100% or higher like this:

HTML:

<div class="someName">
    <!-- child elements -->
</div>

CSS:

.someName {
    min-height: 100%;
}

Upvotes: 4

Related Questions