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.

Reworking the site to use thumbnails<br />

You’re now going to make this page more usable by substituting a<br />

smaller image (which we’ll call a thumbnail) for each photo, and then<br />

you’ll create a link from that thumbnail to each of the larger photos.<br />

Here’s how you’re going to do this, one step at a time:<br />

1<br />

2<br />

3<br />

4<br />

Create a new directory for the thumbnails.<br />

Resize each photo to 150 by 100 pixels and save it in a<br />

“thumbnail” folder.<br />

Set the src of each element in “index.html”<br />

to the thumbnail version of the photo.<br />

Add a link from each thumbnail to a new page<br />

containing the larger photo.<br />

Create a new directory for thumbnails<br />

To keep things organized, create a separate folder for the thumbnail<br />

images. Otherwise, you’ll end up <strong>with</strong> a folder of larger images<br />

and small thumbnails all lumped together, which could get quite<br />

cluttered after you’ve added a significant number of photos.<br />

Create a folder called “thumbnails” under the “mypod” folder. If<br />

you’re working from the book example files, you’ll find this folder<br />

already in there.<br />

photos<br />

mypod<br />

thumbnails<br />

<br />

.<br />

.<br />

.<br />

<br />

index.html<br />

Create a new folder<br />

called “thumbnails” in<br />

the “mypod” folder.<br />

adding images to your web pages<br />

you are here 195

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

Saved successfully!

Ooh no, something went wrong!