13.02.2013 Views

WEB STANDARDS CREATIVITY

WEB STANDARDS CREATIVITY

WEB STANDARDS CREATIVITY

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Setting the width of the container<br />

I generally start the CSS build working from the outside elements inwards. I begin by setting the width of the container div.<br />

#container {<br />

float: left;<br />

width:750px;<br />

margin:0 auto;<br />

text-align: left;<br />

background: #fff url(grid_background.gif) repeat-y;<br />

}<br />

The declarations are pretty straightforward. I’m defining an overall global width of 750px; this is because my column width<br />

is 125px multiplied by 6. The top and bottom margins are effectively removed, and the left and right margins are set to auto<br />

to center the div in the browser window (see Figure 6-14).<br />

Figure 6-14. Centering the grid<br />

chapter 6 Grid Design for the Web<br />

145

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!