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.

how flow works<br />

How it all works together<br />

Now that you know how block and inline elements are<br />

flowed, let’s put them together. We’ll use a typical page<br />

<strong>with</strong> headings, paragraphs, and a few inline elements like<br />

spans, some emphasis elements, and even images. And,<br />

we can’t forget inline text.<br />

h1<br />

h2<br />

p<br />

h2<br />

p<br />

p<br />

p<br />

We’re starting <strong>with</strong> a browser<br />

window that’s been resized to<br />

a fairly wide width.<br />

text<br />

text<br />

492 Chapter 12<br />

text<br />

text<br />

span em span em<br />

text<br />

text<br />

text<br />

img img img img<br />

Each block element is<br />

flowed top to bottom<br />

as you’d expect, <strong>with</strong> a<br />

linebreak in between each.<br />

And the inline<br />

elements are<br />

flowed from the<br />

top left to the<br />

bottom right<br />

of the element’s<br />

content area.<br />

If the inline content of each block fits the<br />

width of the content area, then it’s placed<br />

there; otherwise, more vertical room is made for<br />

the content and it’s continued on the next line.<br />

Here, we’ve resized the browser<br />

window, squeezing all the content<br />

into a smaller horizontal size.<br />

Things flow the same way, although in<br />

some places, the inline elements take<br />

up more vertical lines to fit.<br />

h2<br />

p<br />

h2<br />

p<br />

p<br />

p<br />

h1<br />

span em span<br />

em<br />

img img<br />

img<br />

text<br />

text<br />

text<br />

text<br />

text<br />

text<br />

text<br />

text<br />

text<br />

text<br />

img<br />

Now the block elements take up<br />

more vertical room because the inline<br />

content has to fit into a smaller<br />

horizontal space.

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

Saved successfully!

Ooh no, something went wrong!