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.

The columns should now line up exactly with the vertical grid lines. But what about the masthead and all those lists? Well,<br />

with a little CSS, I can remove the bullets, display them in a line, and make sure the height of the masthead is related to the<br />

typography within it.<br />

Once I have the alignment correct, I remove the gray from the columns and, for the purposes of this example, I add a height<br />

to the columns to show how the grid would extend when there is content in the divs.<br />

Styling the masthead and the language menu<br />

The masthead is simply floated left and given a width of 100%, to make sure the div stretches all the way across.<br />

#masthead {<br />

float:left;<br />

width:100%;<br />

background: #000;<br />

margin: 1em 0 0 0;<br />

}<br />

The languages menu, as you can see from the HTML, is just a with an id of language. First, I give it a little padding<br />

above so the type doesn’t touch the top of the browser window. This is set in pixels, unlike all my other typography measurements,<br />

which are set in ems, because I don’t want this value to change when the text is resized. I want it to be over on<br />

the right, so I float the whole list right and give it a list-style of none, to get rid of the bullets.<br />

#language {<br />

padding: 2px 0 0 0;<br />

float: right;<br />

list-style:none;<br />

}<br />

Next, I float each left, and add some padding to both sides. Note this padding is declared in ems rather than pixels. This<br />

is because when the text is resized, I want this space to be proportionally retained. If this measurement were given in pixels,<br />

the space would resize in Internet Explorer, but the text would not. Finally, I add a border to the right to visually separate the<br />

elements.<br />

#language li {<br />

float: left;<br />

padding: 0 1em 0 1em;<br />

border-right: 1px solid #fff;<br />

}<br />

Then I make the links white to stand out against the black. I will be overriding this default color with a separate color style<br />

sheet, but I always find it easier to begin developing in black and white.<br />

#language li a {<br />

color: #fff;<br />

}<br />

I find that designing in black and white first helps clarify the design decisions I’m making. If color isn’t part of<br />

the problem, remove it and think about it another time.<br />

chapter 6 Grid Design for the Web<br />

147

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

Saved successfully!

Ooh no, something went wrong!