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.

there are no<br />

Dumb Questions<br />

Q: I think I know what a linebreak is; it’s like hitting the carriage return on<br />

a typewriter or the return key on a computer keyboard. Right?<br />

A: Pretty much. A linebreak is literally a “break in the line,” like<br />

this, and happens when you hit the Return key, or on some computers, the Enter key. You already know that<br />

linebreaks in <strong>HTML</strong> files don’t show up visually when the browser displays a page, right? But now you’ve also<br />

seen that any time you use a block element, the browser uses linebreaks to separate each “block”.<br />

Once again, this<br />

all sounds great,<br />

but why is all this talk of<br />

linebreaks, blocks, and inline<br />

elements useful? Can we get<br />

back to Web pages?<br />

Don’t underestimate the power of knowing how <strong>HTML</strong><br />

works. You’re soon going to see that the way you<br />

combine elements in a page has a lot to do <strong>with</strong> whether<br />

elements are block or inline. We’ll get to all that.<br />

In the meantime, you can also think about block versus<br />

inline this way: block elements are used as the major<br />

building blocks of your Web page, while inline elements<br />

mark up small pieces of content. When you’re designing<br />

a page, you typically start <strong>with</strong> the bigger chunks (the<br />

block elements) and then add in the inline elements as<br />

you refine the page.<br />

The real payoff is going to come when we get to<br />

controlling the presentation of <strong>HTML</strong> <strong>with</strong> <strong>CSS</strong>. If you<br />

know the difference between inline and block, you’re<br />

going to be sipping martinis while everyone else is still<br />

trying to get their layout right.<br />

building blocks<br />

you are here 95

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

Saved successfully!

Ooh no, something went wrong!