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.

3<br />

4<br />

Trace a path from the source to the destination.<br />

Let’s trace the path. To get from the “lounge.html” file to “elixir.html”, we need to go<br />

into the “beverages” folder first, and then we’ll find “elixir.html” in that folder.<br />

about<br />

<br />

.<br />

.<br />

.<br />

<br />

directions.html<br />

lounge<br />

<strong>First</strong> we need to<br />

go down into the<br />

“beverages” folder.<br />

beverages<br />

And “elixir.html” is<br />

directly in that folder.<br />

<br />

.<br />

.<br />

.<br />

<br />

lounge.html<br />

<br />

.<br />

.<br />

.<br />

<br />

elixir.html<br />

Create an href to represent the path we traced.<br />

images<br />

Now that we know the path, we need to get it into a format the browser<br />

understands. Here’s how you write the path:<br />

<strong>First</strong> we go into the<br />

beverages folder.<br />

Separate all parts of<br />

the path <strong>with</strong> a “/”.<br />

beverages / elixir.html<br />

Putting it all together...<br />

going further <strong>with</strong> hypertext<br />

drinks.gif<br />

Finally we have the<br />

file name.<br />

elixirs<br />

green.jpg<br />

We put the relative path into the href value. Now when the link is clicked on,<br />

the browser will look for the “elixir.html” file in the “beverages” folder.<br />

blue.jpg<br />

lightblue.jpg<br />

red.jpg<br />

you are here 61

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

Saved successfully!

Ooh no, something went wrong!