ruk·si

CSS
Fixed Sidebar

Updated at 2014-10-24 11:53

Example

I have a fixed width and like etc.
My width is flexible, I expand to the whole remaining width of the container.

Markup

Note that you should additionally clear floats like normal.

<div class="container">
    <div class="left">
        I have a fixed width and like etc.
    </div>
    <div class="right">
        My width is flexible, I expand to the whole remaining width of
        the container.
    </div>
</div>
.container {
    width: 100%;
}
.left {
    width: 100px;
    background: blue;
    color: white;
    float: left;
}
.right {
    width: auto;
    background: red;
    overflow: hidden;
}

Source