Prev

Breaking Up Text

There are many ways to break up text in HTML, three of which are to use line breaks, horizontal rules, or blockquotes.

Line Breaks

Try It: Use the <br /> tag. Try one by itself and several in a row.

The <br /> tag
This is a nifty line<br />break<br /><br />
That was two in a row!
will appear as:
This is a nifty line
break

That was two in a row!
In the last lesson you learned that when browsers display a <p> tag, they usually display a blank line before and after the paragraph. However, there are times you may want to add a blank line yourself within a paragraph or not inside a paragraph at all, or even many blank lines in a row. You can do this with the <br /> tag.

The <br /> tag is a stand-alone tag - it does not open and close like the other tags you have learned so far. Putting just one <br /> causes a line break - the text after the <br /> starts on the next line. Putting two <br /> tags in a row makes a blank line. You can put as many <br /> tags as you want to get many blank lines.

Horizontal Rule

Try It: Add a <hr /> to your code
Hey look:
That was a horizontal rule!
Another way to break up text on your page is to add a horizontal rule with the <hr /> tag, another stand-alone tag. A horizontal rule is simply a line going all the way across the page. Horizontal rules look slightly different on different browsers.

Blockquote

Try It: Use the <blockquote> tag.
The <blockquote> tag allows you to show off long quotations. Most browsers display <blockquote> by adding a blank line before and after the quote, indenting both the left and right margins, and sometimes using italics. The quote below is displayed using blockquote:
"Not only have women been successful in entering fields in which men are supposed to have a more natural aptitude, but they have created entirely new businesses." –Lucretia P. Hunter, 1932

Although it is not good style, you can use blockquote as a quick and dirty way to get any paragraph to indent, not just a quotation.

End of Topic

Prev