Max Frai
Max Frai

Reputation: 64366

html - div, minimal size

how can i set minimal height for div? But it have to resize with new data.

Upvotes: 1

Views: 306

Answers (4)

GafroNinja
GafroNinja

Reputation:

div#name
{
    height: 60px;
    height: auto !important;
    min-height: 60px;
}

This should work across browsers including IE

Upvotes: 1

marcgg
marcgg

Reputation: 66515

min-height works fine... except in IE.

The way to fix it and therefore use it everywhere is importing ie7.js

Upvotes: 1

Dominic Rodger
Dominic Rodger

Reputation: 99841

You want the CSS property min-height. You'll need to be careful of not great browser support (particularly older versions of IE, shockingly enough).

Upvotes: 0

meder omuraliev
meder omuraliev

Reputation: 186742

div#foo {
min-height:10em;
}

in ie6.css or prepend with * html selector ( hack warning )

div#foo { height:10em; }

Since MSIE6 doesn't support min-height.

Upvotes: 0

Related Questions