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.

Padding, border, and margins for the guarantee<br />

Now that you’ve seen how the padding, border, and margins are<br />

currently set on the guarantee paragraph, let’s think more about<br />

how we’d actually like them to look.<br />

We’re also going to need a<br />

slightly different border.<br />

This border looks ragged,<br />

not like a solid line.<br />

Adding some padding<br />

We definitely need some padding<br />

all around the content.<br />

And we want some more margin<br />

space around the paragraph.<br />

Let’s start <strong>with</strong> the padding. <strong>CSS</strong> has a padding property that you can<br />

use to set the same padding for all four sides of the content. You can set<br />

this property either to a number of pixels or a percentage of area inside<br />

the border. We’ll use pixels and set the padding to 25 pixels.<br />

.guarantee {<br />

border-color: black;<br />

border-width: 1px;<br />

border-style: solid;<br />

background-color: #a7cece;<br />

padding: 25px;<br />

}<br />

Our guarantee: at the lounge, we’re<br />

committed to providing you, our guest,<br />

<strong>with</strong> an exceptional experience every<br />

time you visit. Whether you’re just<br />

stopping by to check in on email over<br />

an elixir, or are here for an out-ofthe-ordinary<br />

dinner, you’ll find our<br />

knowledgeable service staff pay attention<br />

to every detail. If you’re not fully satisfied<br />

have a Blueberry Bliss Elixir on us.<br />

We’re adding 25 pixels of padding<br />

to all sides of the content (top,<br />

right, bottom, and left).<br />

the box model<br />

you are here 401

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

Saved successfully!

Ooh no, something went wrong!