HTML HTML Tutorial HTML Forms HTML Graphics HTML Media HTML APIs HTML Tags



HTML Tag: br

The HTML tag br is a line break tag that is used to insert a line break or a new line in the HTML document. It is a self-closing tag, which means it does not require a closing tag. The br tag is commonly used to create a new line after a paragraph or to separate content into different lines.

The br tag is a simple and easy-to-use tag that can be used in various ways to format the content of an HTML document. It is a very useful tag for creating lists, addresses, and other types of content that require line breaks.

Code Examples

Here are some examples of how the br tag can be used in HTML:

Example 1: Creating a New Line

To create a new line in HTML, you can use the br tag as follows:

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

The above code will produce the following output:

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

Example 2: Creating a List

The br tag can also be used to create a list in HTML. Here is an example:

  <ul>
    <li>Item 1<br></li>
    <li>Item 2<br></li>
    <li>Item 3<br></li>
  </ul>

The above code will produce the following output:

  • Item 1
  • Item 2
  • Item 3

Example 3: Creating an Address

The br tag can also be used to create an address in HTML. Here is an example:

  <address>
    John Doe<br>
    123 Main Street<br>
    Anytown, USA 12345<br>
  </address>

The above code will produce the following output:

John Doe
123 Main Street
Anytown, USA 12345

Conclusion

The br tag is a simple and easy-to-use tag that can be used in various ways to format the content of an HTML document. It is a very useful tag for creating lists, addresses, and other types of content that require line breaks.

Reference

Activity