04.06.2013 Views

Head First HTML with CSS

Head First HTML with CSS

Head First HTML with CSS

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

examining a two column page<br />

Did you do the Super Brain Power?<br />

If you didn’t do the Super Brain Power at the end of<br />

the last chapter, then march right back there and<br />

do it. It’s required.<br />

Okay, now that we have that out of the way, at<br />

the end of the last chapter, we left you <strong>with</strong> a bit<br />

of a cliffhanger. We asked you to move the elixirs<br />

up under the logo, and then add one little<br />

property to the elixirs rule in your <strong>CSS</strong>, like this:<br />

488 Chapter 12<br />

float: right;<br />

And, wow, what a difference one property<br />

can make! All of a sudden the page has gone<br />

from a fairly ordinary-looking Web page to a<br />

great-looking Web page <strong>with</strong> two columns. It’s<br />

immediately more readable and pleasant to the<br />

eye.<br />

So what’s the magic? How did this seemingly<br />

innocent little property produce such big effects?<br />

And, can we use this property to do even more<br />

interesting things <strong>with</strong> our pages? Well, of course,<br />

this is <strong>Head</strong> <strong>First</strong>, after all. But first, you’re<br />

going to need to learn how a browser lays out<br />

elements on a page. Once you know that, we can<br />

talk about all kinds of ways you can alter how it<br />

does that layout, and also how you can start to<br />

position your elements on the page.<br />

Here’s the good news: you already know all<br />

about block elements and inline elements, and<br />

you even know about the box model. These are<br />

the real foundations of how the browser puts<br />

a page together. Now all you need to know is<br />

exactly how the browser takes all the elements in<br />

a page, and decides where they go.

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

Saved successfully!

Ooh no, something went wrong!