HTML and CSS Reference
Q: I think I know what a linebreak is; it's like hitting the carriage return
on a typewriter or the Return key on a computer keyboard. Right?
A: Pretty much. A linebreak is literally a “break in the line,” like
this, and happens when you hit the Return key, or on some computers, the Enter
key. You already know that linebreaks in HTML files don't show up visually when
the browser displays a page, right? But now you've also seen that anytime you
use a block element, the browser uses linebreaks to separate each “block.”
Once again, this all sounds great,
but why is all this talk of linebreaks,
blocks, and inline elements useful? Can
we get back to web pages?
Don't underestimate the power of knowing how HTML
works. You're soon going to see that the way you combine
elements in a page has a lot to do with whether elements
are displayed as block or inline. We'll get to all that.
In the meantime, you can also think about block versus
inline this way: block elements are often used as the major
building blocks of your web page, while inline elements
usually mark up small pieces of content. When you're
designing a page, you typically start with the bigger
chunks (the block elements) and then add in the inline
elements as you refine the page.
The real payoff is going to come when we get to
controlling the presentation of HTML with CSS. If you
know the difference between inline and block, you're
going to be sipping martinis while everyone else is still
trying to get their layout right.