Chapter 9: Page Layout
372
<body>
<div id=”page”>
<!-- CONTENT OF PAGE GOES HERE -->
</div>
</body>
Figure 9-8
Now take a look at the CSS rules that correspond with this element (ch09_eg02.
css):
div#page{
width:880px;
padding:20px;
margin-left:auto;...
More
Chapter 9: Page Layout
372
<body>
<div id=”page”>
<!-- CONTENT OF PAGE GOES HERE -->
</div>
</body>
Figure 9-8
Now take a look at the CSS rules that correspond with this element (ch09_eg02.
css):
div#page{
width:880px;
padding:20px;
margin-left:auto;
margin-right:auto;
background-color:#ffffff;
border:1px solid #666666;
font-size:12px;}
text-align:left;}
As you can see, the width property is used to fix the size of the page, and its value is specified in pixels.
No matter how big or small the visitor’s browser window is, this element remains the same size.
If the
user’s browser is narrower than the layout specifies, horizontal scrollbars will appear, whereas if the
window is wider than the layout specifies, there will be space to the side of the page.
Less