views:

328

answers:

3

%19 Left Section Width, %80 Content width:

alt text

But i want to fix left section to 200px and content section is the rest of viewable area's width.

How can i do this with CSS?

<html>
<head>
    <title>TWO-COLUMN LIQUID LAYOUT WITH FLOATING BOXES</title>
    <style type="text/css">
        body
        {
            margin: 0px;
            padding: 0px;
        }
        div
        {
            border: 1px solid black;
        }
        #header
        {
            background: #0f0;
            width: 100%;
        }
        #leftcol
        {
            background: #f00;
            float: left;
            width:19%;
            /* max-width: 200px; */ 
            height: 500px;
        }
        #content
        {
            background: #fff;
            float: left;
            width: 80%;
            height: 500px;
        }
        #footer
        {
            background: #0f0;
            clear: both;
            width: 100%;
        }
    </style>
</head>
<body>
    <div id="header">
        Header Section</div>
    <div id="leftcol">
        Left Section</div>
    <div id="content">
        Content Section</div>
    <div id="footer">
        Footer Section</div>
</body>
</html>
+1  A: 

Take a look: http://www.brunildo.org/test/lf100r.html

Nimbuz
+2  A: 

There's plenty of ready made templates that would work here, take a look at these for example:

Tatu Ulmanen
A: 

The basic structure with a faux column approach for the left fixed column without header or footer which are of course also easy to add:

<body>
    <div id="wrap">
        <div id="inner-wrap">
            <div id="left-col">

            </div>
            <div id="right-col">


            </div>
        </div>
    </div>
</body>

The basic css for this layout, add some reset rules at the top:

/* Main Layout Positions */

html {
    height: 100%;
}

body {
    height: 100%;
}

#wrap {
    background: url(../images/false-column.gif) top left repeat-y;
    min-height: 100%;
    margin: auto;
    position: relative;
}

* html #wrap {
    height: 100%;
}

#inner-wrap:after {
    content: " ";
    display: block;
    clear: both;
}

#left-col {
    float:left;
    width:395px;
}

#right-col {
    position: relative;
    margin-left: 395px;
}
tharkun