Clearing block affects wrong floating

Posted by HiveHicks on Stack Overflow See other posts from Stack Overflow or by HiveHicks
Published on 2010-06-11T07:55:13Z Indexed on 2010/06/11 8:03 UTC
Read the original article Hit count: 235

Filed under:
|
|

I've got two-column layout

 <div class="left-pane">
        Left pane
    </div>
    <div class="central-pane">
        <div>
            <ul class="customers-types-tabs">
                <li>item 1</li>
                <li>item 2</li>
                <li>item 3</li>
            </ul>
        </div>
        <div>Main content</div>
    </div>

and the stylesheet:

.left-pane {
    width: 248px;
    float: left;
    background-color: #f6f6f6;
    border: 1px solid #e6e6e6;
    padding: 20px 5px;
}
.central-pane {
    margin-left: 270px;
}
.customers-types-tabs li {
    background-color: #f6f6f6;
    border: 1px solid #d5d5d5;
    line-height: 38px;
    padding: 0 20px;
    float: left;
    margin-right: 10px;
    position: relative;
    top: 1px;
}

The problem is that I want "Main content" to appear right below the div with ul inside it (that represents tabs control), but if I set Main content's div's style to clear: both, it appears below the left pane, which is taller than the ul. What should I do to get correct position of main content?

© Stack Overflow or respective owner

Related posts about css

Related posts about float