Reputation: 382
I've a div inside another div that wants to show at the bottom. But it wont. Look at the code:
...
<td valign="top" style="height: 900px;">
<center>
<div class="sidebar">
<div id="block_sub">Hello</div>
</div>
</center>
</td>
...
<styles>
.sidebar{
position: relative;
}
#block_sub{
position: absolute;
bottom: 0;
}
</styles>
Upvotes: 0
Views: 70
Reputation: 2374
Works fine for me:
You made two mistakes through:
You used #sidebar
instead of .sidebar
, and you didn't give your outer div a height.
Use this:
.sidebar{
position: relative;
background: red;
}
#block_sub{
position: absolute;
bottom: 0;
background: blue;
}
Upvotes: 2