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.

images and layout<br />

Take myPod for another test drive<br />

Ahhh... much better. Visitors can see all the<br />

available pictures at a glance. They can also tell<br />

which photos go <strong>with</strong> each city more easily. Now we<br />

need to find a way to link from each thumbnail to<br />

the corresponding large image.<br />

Wait a sec, don’t<br />

you think you’re<br />

pulling a fast one? The<br />

images used to be on top<br />

of each other; now<br />

they’re side by side.<br />

198 Chapter 5<br />

Right; but remember the element<br />

is an inline element.<br />

In other words, we didn’t “pull anything.” Because <br />

is an inline element, it doesn’t cause linebreaks to be<br />

inserted before and after the element is displayed. So, if<br />

there are several images together in your <strong>HTML</strong>, the<br />

browser will fit them side by side if the browser window is<br />

wide enough.<br />

The reason the larger photos weren’t side by side is<br />

because the browser didn’t have room to display them<br />

next to each other. Instead, it displayed them on top<br />

of each other. A browser always displays vertical space<br />

before and after a block element, and if you look back at<br />

the screenshots, you’ll see the images are right on top of<br />

each other <strong>with</strong> no space in between. That’s another sign<br />

is an inline element.

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

Saved successfully!

Ooh no, something went wrong!