Aligning DIVs with CSS: get your nest on
I still hate CSS. For me, its like 1998 all over again. While managing my hate I would like to share some pointers about how to do some common things in CSS with DIVs that you already know how to do with TABLES. But fuck TABLES, right.
So I have a div with some content that I need aligned within another block of space. After fiddling with the thing forever I finally found the technique... nest an absolute positioned DIV inside a relative positioned DIV and boom, the DIV can be placed anywhere you want inside the parent DIV (the relative one).
Vertical alignments
So I have a div with some content that I need aligned within another block of space. After fiddling with the thing forever I finally found the technique... nest an absolute positioned DIV inside a relative positioned DIV and boom, the DIV can be placed anywhere you want inside the parent DIV (the relative one).
div#outerdiv
{
position:relative;
padding:0;
margin: 0;
height:47px;
}
div#innerdiv
{
margin: 0px 0 0 0;
position:absolute;
bottom:0px;
right:0;
height:22px;
}
<div class="outerdiv">
<div class="innerdiv">
</div>
</div>