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.

linking to other web pages<br />

How do we link to other Web sites?<br />

URLs aren’t just for typing into browsers; you can use them right in your<br />

<strong>HTML</strong>. And, of course, right on cue, the Starbuzz CEO has a new task<br />

for you: make a link from the main Starbuzz page over to the caffeine<br />

information at http://buzz.headfirstlabs.com. As you can<br />

probably guess, we’re going to throw that URL right into an element.<br />

Here’s how:<br />

144 Chapter 4<br />

Fantastic! We’re up and<br />

running on the Web. I’m<br />

already hearing great buzz<br />

about our site in the stores. By the way, we’ve got a new<br />

caffeine awareness program; we<br />

figure if we’re going to be pumping people<br />

full of caffeine we want them to know<br />

how to take it to the limit. Can we point<br />

people to the caffeine information<br />

over on buzz.headfirstlabs.com from<br />

our site?<br />

Caffeine Buzz<br />

An everyday, normal, gardenvariety<br />

element.<br />

We’ve put a URL in the href. Clicking on the label “Caffeine Buzz”<br />

will retrieve a page from buzz.headfirstlabs.com.<br />

That’s all there is to it. To link to any resource on the Web, all you need is its<br />

Uniform Resource Locator, which goes in the element as the value of the<br />

href attribute. Let’s go ahead and add this in the Starbuzz “index.html” page.

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

Saved successfully!

Ooh no, something went wrong!