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.

Adding some real style to<br />

the elixirs section<br />

So far, so good. We’ve found a way to get<br />

that border around the entire section. Now<br />

you’re going to see how to use the to<br />

customize the styling of the entire elixirs section<br />

independent of the rest of the page.<br />

We obviously have some padding issues to deal<br />

<strong>with</strong>, because the border is right up against the<br />

content. But there’s a lot of other style we need<br />

to work out, too. Let’s take a look at everything<br />

we need to take care of...<br />

The main heading<br />

and the paragraph<br />

text are black, while<br />

the drink names are<br />

a red color that<br />

matches the red in<br />

the logo.<br />

The text and images<br />

are centered, and<br />

there’s padding on<br />

the sides to add<br />

space between the<br />

text and the border.<br />

The line-height of the<br />

paragraphs looks a lot more<br />

like the default line height for<br />

the page (before we changed it<br />

in the last chapter).<br />

The font family is a sans-serif font, just<br />

like the body font, so we don’t have to<br />

change that. Remember that the <br />

element and all the elements nested in it<br />

inherit the font family from the body.<br />

This link is aquamarine.<br />

There’s a background<br />

image at the top.<br />

divs and spans<br />

The width of the elixirs<br />

handout is narrower than the<br />

rest of the page.<br />

you are here 441

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

Saved successfully!

Ooh no, something went wrong!