width:1008px
すべてのモニターで固定幅のレイアウトを目指しています。これが私のHTMLです-
<body>
<div id="god_container">
<div id="root">
... all content ...
</div>
</div>
</body>
およびCSS -
#god_container{
background:url("/site_media/images/bg-1008.png") repeat-y scroll center center #D4D9DD;
margin:auto;
position:static;
width:auto;
}
#root {
background-color:#FFFFFF;
margin:auto;
width:1008px;
color:#000000;
font-family:Verdana,Arial,sans-serif;
font-size:10pt;
}
body{
color:#373737;
font:16px arial;
line-height:1;
background-color:#D4D9DD;
}
これで解決すると思いました。しかし、レンダリングすると、root
css が値に準拠しません1008px
。また、ルートは白background-color
として表示されません。#FFFFFF
それはまだ私body
の ものを示していますbackground-color
。私は何を間違っていますか?
更新: 興味のある方へhttp://www.dynamicdrive.com/style/layouts/category/C12/で優れた既製の CSS レイアウトを見つけました。