BTC
BTC

Reputation: 4062

Div is not automatic height as specified

I cannot seem to get my div's height to set automatically.

despite setting a min-height and

height:auto

Upvotes: 0

Views: 31

Answers (1)

Marc Audet
Marc Audet

Reputation: 46785

You need to clear your floats or set overflow: auto to your parent container:

#Mid_Container {
    width:1048px;
    height:auto;
    min-height:1100px;
    margin:0 auto;
    margin-top:15px;
    padding:0;
    position:relative;
    border:1px solid #a9a9a9;
    background-color:#f7f7f7;
    overflow: auto; /* cause this block to enclose floated child elements */
}

Modified jsfiddle: http://jsfiddle.net/audetwebdesign/JRd9z/1/

Upvotes: 2

Related Questions