PDA

View Full Version : minium height in div



Colin-Roberts
24-12-2007, 02:34 PM
is it possible to have a minium height in a div but it will go bigger if needed?

Josh-H
24-12-2007, 03:25 PM
Yep, its pretty simple.

Just use CSS's "min-height" feature.

In a style sheet it would be like


div {
min-height: 10px;
}

or without a style sheet:


<div style="min-height: 10px;">Content.</div>

You can also use this feature with percentages for instance if you wanted a div to be at least 10% of the page :).

Colin-Roberts
24-12-2007, 03:34 PM
Excellent +rep

RYANNNNN
24-12-2007, 06:42 PM
I'm not 100% sure if it works in IE without a width set, and you might need to add overflow: auto;

Colin-Roberts
24-12-2007, 07:52 PM
i ended up not needing this anyway because i changed the navi.

Want to hide these adverts? Register an account for free!