I am trying to create a layout using a fixed title and sidebar, but I do not want the layout to be in the center of the browser. Obviously, this is a problem, since a fix usually does not allow this. I thought about wrapping everything around and using margin: 0px auto; etc., but it didn’t work, is it possible or not?
#header { position: fixed; top: 0; left: 0; width: 100%; height: 150px; background-color: #FFF; z-index: 100; } #content { width: 1112px; overflow: auto; padding-top: 150px; } #sidebar { position: fixed; top: 0; left: 0; width: 275px; height: 100%; z-index: 100; }
If this were the case, but this did not work:
body { margin:0px 0px; padding:0px; text-align:center; } #wrapper { text-align: left; margin: 0px auto; }
divas:
<div id="wrapper"> <div id="header"></div> <div id="content"></div> <div id="sidebar"></div> </div>
source share