How to prevent right div from collapsing under left float on full page layout

My first crack at a full page layout. I have a left div that is a block style nav.

#admin_nav {
    width: 230px;
    height: 100%;
    background-color: #f9f9f9;
    border-right: 1px solid #ddd;
    float: left;
}

I then have the content which is to the right. At first I floated both left and cleared it but when the browser re sized smaller, the right div collapsed under the left div. I then made the right div a margin auto but it still collapses under the left.

#admin_content {
    width: 750px;
    padding: 20px;
    margin: auto;
}

I think I can use a wrap to prevent the right div from moving underneath the left float, but how do I do a full page wrap?


#admin_nav { 
    position: absolute; 
    left: 0; top: 0;
}

#admin_content {
    position: relative;
    margin-left: 230px;
}
链接地址: http://www.djcxy.com/p/15564.html

上一篇: 将父项展开为浮动子div

下一篇: 如何防止右div在完整页面布局的左浮动下折叠