Using The Br Tag - Line Break Tag

Using the br Tag - Line Break Tag

The line break tag is the <br> tag in HTML and <br /> in XHTML.

A br tag will insert a line break which means the text/image following the tag will be moved to the next line when displayed in the browser.

The following is a regular paragraph.

This is a regular paragraph. Everything between the opening and closing paragraph tags keeps flowing. The paragraph tag adds a line before and after the paragraph, unlike the br tag.

HTML coding for the above paragraph:

<p>This is a regular paragraph. Everything between the opening and closing paragraph tags keeps flowing. The paragraph tag adds a line before and after the paragraph, unlike the br tag.</p>

This paragraph uses the HTML br tag (line break tag) at the end of each sentence:

When you insert a br tag into your HTML coding it creates a line break. The text in this sentence is after a br tag. Here's a new sentence with the br tag inserted before it.

HTML coding for the above paragraph:

<p>When you insert a br tag into your HTML coding it creates a line break.<br /> The text in this sentence is after a br tag.<br /> Here's a new sentence with the br tag inserted before it.</p>

Note: The above sample coding is done in XHMTL, for HTML you would substitute a <br> tag where you see <br />.

The line break tag (br tag) can also be used to have text run above and below an image.

Here's some text before the image. HTML Basic Tutor This text was moved below the image using the line break (<br>) tag.

Notice that the text moved one line below the image.

This paragraph is surrounded by the <p> and </p> (paragraph) set of tags. Notice that there is a blank line above the start of this paragraph and below it.

Using the line break (br tag) can be useful for forcing the layout of a web page. Don't go over board though. A string of br tags is not the right solution to create a forced layout. There are other formatting ways to create a forced layout.

If you found this web page a useful resource for your own website please link as follows:

HTML Basic Tutor - www.htmlbasictutor.ca/

Using the br tag (line break tag) in HTML coding to move text or image to a new line. URL:

Từ khóa » Html Br Substitute