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.

Linking from “lounge.html” to the external style sheet<br />

Now we need a way to tell the browser that it should style this page <strong>with</strong> the<br />

styles in the external style sheet. We can do that <strong>with</strong> an X<strong>HTML</strong> element<br />

called . Here’s how you use the element in your X<strong>HTML</strong>:<br />

<br />

<br />

<br />

<br />

<strong>Head</strong> <strong>First</strong> Lounge<br />

<br />

<br />

<br />

<br />

<br />

Welcome to the <strong>Head</strong> <strong>First</strong> Lounge<br />

<br />

<br />

<br />

.<br />

.<br />

.<br />

<br />

<br />

<br />

X<strong>HTML</strong> Up Close<br />

The rest of the X<strong>HTML</strong> is the same.<br />

Let’s take a closer look at the element since you haven’t seen it before:<br />

Use the link element<br />

to “link in” external<br />

information.<br />

The type of this information is<br />

“text/css”. In other words, a<br />

<strong>CSS</strong> style sheet.<br />

getting started <strong>with</strong> css<br />

Here’s the X<strong>HTML</strong> that links<br />

to the external style sheet.<br />

You don’t need the element<br />

any more - just delete it.<br />

<br />

The rel attribute specifies the relationship between<br />

the X<strong>HTML</strong> file and the thing you’re linking to. We’re<br />

linking to a style sheet, so we use the value “stylesheet”.<br />

And the style sheet is located<br />

at this href (in this case we’re<br />

using a relative link, but it could<br />

be a full-blown URL).<br />

is an<br />

empty element.<br />

you are here 305

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

Saved successfully!

Ooh no, something went wrong!