HTML and CSS Reference
In-Depth Information
Viewing this markup in the browser reveals that the line breaks go
wherever the elements and the size of the window dictate:
If there's a situation where a paragraph requires a line break, such as
an address or a verse of poetry, you can use the <br> element:
<p>The Analytical Engine
weaves algebraic <br> patterns,
just as the <br> Jacquard loom
weaves <br> flowers
and <br> leaves.</p>
The <br> element is unique among those covered so far because it con-
sists of a single tag. It can have no children. The <br> element and oth-
ers like it are known as self-closing elements . They're sometimes written
with a closing slash like this: <br/> .
Line breaks aren't for layout
A common beginner's mistake is to use line-break elements or empty paragraph
tags to increase vertical spacing between two other elements. There's no need
to do this in HTML: spacing between elements can be entirely controlled with
Cascading Style Sheets (CSS, covered in appendix C).
HTML is for describing content, not presentation. You'll benefit in the long run
if you avoid using meaningless, empty elements for layout.
HTML's ability to ignore spacing and line breaks and reflow text to fit
the available space is usually an advantage: text flows automatically
Search WWH ::




Custom Search