Hi all,

I have a question about positioning elements on a webpage.

I have a central block of content in the middle of the page:

.main {
border:1px solid #000;
clear: both;
margin:15px auto;
width: 800px;
}

I'm also positioning a sidebar to the left of this centered block:

.sidebar {
    border:1px solid #000;
    clear: both;
    float: left; /* pushes the sidebar to the left */
    margin-left: -40px; /* pushes the sidebar to the left */
    margin-top: 15px;
    position: absolute;
    width: 200px; height: 400px;
}


However, this approach isn't working because the gap between the sidebar
and the center block isn't maintained: the sidebar occasionally overlaps
with the centered block or goes too far away from it, depending on the
scale of the browser.

How should I arrange the CSS for the sidebar such that it always maintains
a consistent gap to the left of the centered block?

I'd appreciate your advice on this; thanks!

Zaia
______________________________________________________________________
css-discuss [css-d@lists.css-discuss.org]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to