Rickstar
Rickstar

Reputation: 6199

how to use auto with a height in css

How would you use auto height? I need the hight to be 250px default the auto is working but i cant get a default hight.

Upvotes: 0

Views: 317

Answers (2)

Bertrand Marron
Bertrand Marron

Reputation: 22220

Maybe min-height ?

As Brian Scott rightly said, min-height is not implemented in IE6, so you could use a JavaScript expression (see this blog article).

* html div#mydiv { 
   height: expression( this.scrollHeight > 249 ? "250px" : "auto" ); 
}

div#mydiv {
  min-height: 250px;
}

Upvotes: 0

Valentin Flachsel
Valentin Flachsel

Reputation: 10825

Perhaps min-height is what you are looking for ?

Upvotes: 3

Related Questions