Computer Study

br Tag in HTML

The <br> tag in HTML stands for “line break” and is used to create a line break or a new line within a paragraph. It is a self-closing tag, which means it doesn’t need a closing tag.

Syntax:

The syntax for the <br> tag is as follows:

<br>

Usage:

The <br> tag is commonly used to create a line break between two lines of text, or to create a new line after an image or other media. Here is an example of how to use the <br> tag to create a line break:

<p>This is the first line.<br>This is the second line.</p>

Output:

This is the first line. This is the second line.

In the above example, the <br> tag is used to create a line break between the first and second lines of text.

Note:

It is important to use the <br> tag appropriately and only when it is necessary to create a line break or a new line. Overusing the <br> tag can make your code difficult to read and maintain. It is also important to note that the <br> tag should not be used to create space between elements or to format the layout of a web page. Instead, CSS should be used for styling and formatting.

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button