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.

Fixing the nesting problem<br />

So it looks like strict <strong>HTML</strong> 4.01 prefers that images, which are<br />

inline elements, be nested inside a block element, like a paragraph or<br />

a heading. That’s a simple change to make. Open your “lounge.html”<br />

file and add a element around the element.<br />

standards, compliance, and all that jazz<br />

<br />

<br />

<br />

<br />

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

<br />

<br />

Welcome to the New and Improved <strong>Head</strong> <strong>First</strong> Lounge<br />

<br />

<br />

<br />

<br />

Join us any evening for refreshing<br />

elixirs,<br />

conversation and maybe a game or two<br />

of Dance Dance Revolution.<br />

Wireless access is always provided;<br />

BYOWS (Bring Your Own Web Server).<br />

<br />

Directions<br />

<br />

You’ll find us right in the center of downtown<br />

Webville. If you need help finding us, check out our<br />

detailed directions.<br />

Come join us!<br />

<br />

<br />

<br />

Once you’ve done that, save and reload the page in your<br />

browser. You’ll see it doesn’t really affect the look of the page.<br />

Why? Because the heading above the image and the paragraph<br />

below are already block elements <strong>with</strong> linebreaks below and<br />

above them, respectively. So the element around the image<br />

doesn’t actually add any new linebreaks or spacing.<br />

Now, the image “drinks.gif” is safely<br />

nested inside a element.<br />

All our other inline elements,<br />

like and , are already<br />

inside block elements - these<br />

paragraphs.<br />

you are here 249

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

Saved successfully!

Ooh no, something went wrong!