Absolute position and floating
        Posted  
        
            by Ruth Rettigo
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by Ruth Rettigo
        
        
        
        Published on 2010-05-08T10:56:30Z
        Indexed on 
            2010/05/08
            10:58 UTC
        
        
        Read the original article
        Hit count: 290
        
Hi,
Do you have any idea, how to style this layout without specifing exact height for "Element 1"?
Code
Element1
{
positon: relative;
width: 100%;
height: auto; /* I don't want to specify exact height */
}
Inner1
{
position: absolute;
top: xyz px;
left: xyz px;
}
Inner2
{
position: absolute;
top: xyz px;
left: xyz px;
}
Element2
{
float: left;
width: 100%;
}
Example
+--------------------------------------------------+
|Element1                                          |
|                              +--------+          |
|     +--------+               |Inner2  |          |
|     |Inner1  |               +--------+          |
|     +--------+                                   |
|                                                  |
|                                                  |
+--------------------------------------------------+
+--------------------------------------------------+
|Element2                                          |
|                                                  |
|                                                  |
+--------------------------------------------------+
© Stack Overflow or respective owner