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.

using and selecting an id<br />

Using an id in the lounge<br />

Our “guarantee paragraph” really should have an id since it’s<br />

intended to be used just once in the page. While we should have<br />

designed it that way from the beginning, making the change is<br />

going to be quite simple.<br />

Step One: change the class attribute to an id in your “lounge.html”:<br />

<br />

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

you, our guest, <strong>with</strong> an exceptional experience every time you<br />

visit. Whether you’re just stopping by to check in on email<br />

over an elixir, or are here for an out-of-the-ordinary dinner,<br />

you’ll find our knowledgeable service staff pay attention to every<br />

detail. If you’re not fully satisfied have a Blueberry Bliss Elixir<br />

on us.<br />

<br />

Step Two: change the “.guarantee” class selector in “lounge.css” to an id selector:<br />

#guarantee {<br />

line-height: 1.9em;<br />

font-style: italic;<br />

font-family: Georgia, “Times New Roman”, Times, serif;<br />

color: #444444;<br />

border-color: white;<br />

border-width: 1px;<br />

border-style: dashed;<br />

background-color: #a7cece;<br />

padding: 25px;<br />

padding-left: 80px;<br />

margin: 30px;<br />

margin-right: 250px;<br />

background-image: url(images/background.gif);<br />

background-repeat: no-repeat;<br />

background-position: top left;<br />

}<br />

418 Chapter 10<br />

Just change the class<br />

attribute to an id.<br />

Just change the “.” to a<br />

“#” in the selector.

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

Saved successfully!

Ooh no, something went wrong!