jim
jim

Reputation: 13

css vertical align help

I'm using a strict doctype and cannot get one of my divs aligned to the bottom. I'd like to specify a 100% height on the parent container and then push the inner container to the floor of the parent. How is this done using a strict doctype?

This is the parent: -- Works as expected. At 100% height

#content_left {
vertical-align:top;
padding:0;
margin:0;
min-width:195px;
color:#fff;
height:100%;
}

This is the inner div: doesnt work

.sidebarmenu {
position:relative;
bottom:0;
height:100%;
border:1px solid red;
}

Upvotes: 1

Views: 157

Answers (3)

Paul D. Waite
Paul D. Waite

Reputation: 98906

Discussing layout issues in text can be tricky, but note that you’ve said you want a <div> aligned to the bottom, but you’ve not said to the bottom of what.

I think you mean the bottom of the browser window. Unfortunately, you can’t really do this in CSS: the root element is always as tall as its content requires, and not as tall as the browser window (if I remember correctly).

Upvotes: 0

Marcus Whybrow
Marcus Whybrow

Reputation: 20008

I think you would need to use absolute positioning and specify bottom: 0:

#content {
    position: absolute;
    bottom: 0;
}

Upvotes: 1

Mark
Mark

Reputation: 427

I'd suggest trying:

#content {position:relative;bottom:0;}

Upvotes: 0

Related Questions