04.06.2013 Views

Head First HTML with CSS

Head First HTML with CSS

Head First HTML with CSS

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.

creating a css file<br />

Creating the “lounge.css” file<br />

You’re going to create a file called “lounge.css” to contain the style rules<br />

for all your <strong>Head</strong> <strong>First</strong> Lounge pages. To do that, create a new text file<br />

named “lounge.css” in your text editor.<br />

about<br />

h1, h2 {<br />

font-family: sans-serif;<br />

color: gray;<br />

}<br />

h1 {<br />

border-bottom: 1px solid black;<br />

}<br />

p {<br />

color: maroon;<br />

}<br />

304 Chapter 8<br />

<br />

.<br />

.<br />

.<br />

<br />

directions.html<br />

lounge<br />

beverages<br />

<br />

.<br />

.<br />

.<br />

<br />

elixir.html<br />

<br />

.<br />

.<br />

.<br />

<br />

lounge.html<br />

h1, h2 {<br />

fon<br />

col<br />

}<br />

p {<br />

lounge.css<br />

images<br />

Now type, or copy and paste from your “lounge.html” file, the <strong>CSS</strong> rules<br />

into the “lounge.css” file. Delete the rules from your “lounge.html” file<br />

while you’re at it.<br />

Note that you should not copy the and tags<br />

because the “lounge.css” file contains only <strong>CSS</strong>, not X<strong>HTML</strong>.<br />

Create “lounge.css” in<br />

the “lounge” folder (the<br />

root folder).<br />

drinks.gif<br />

green.jpg<br />

red.jpg<br />

blue.jpg<br />

lightblue.jpg<br />

Your “lounge.css” file should<br />

look like this. Remember, no<br />

tags!<br />

We often call <strong>CSS</strong><br />

files “style sheets”.

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

Saved successfully!

Ooh no, something went wrong!