HTML - <br> Tag



Introduction to <br> Tag

The HTML <br> (line break) tag is used to insert a line break within the text or content on the webpage. Unlike the block-level elements like <p> or <div> the <br> tag does not create a new block of content, instead it moves the text to a new line while remaining within the same block of content. It is a self closing tag and does not depend on the end tag.

This tag is particularly used when formatting content requires breaks but does not permit the new paragraph or block, such as in poems, address.

Syntax

Following is the syntax of HTML <br> tag −.

<br>

Attributes

HTML br tag supports Global and Event attributes of HTML. A specific attribute accepted as well which is listed below.

Attribute Values Description
clear No Value This ensure that line breaks "cleared" floated or aligned elements above them.

Example : Basic Usage

Let's consider the following example, where we are going to consider the basci usage of the <br> tag.

<!DOCTYPE html>
<html>
<body>
   <p>
      Geckos are a group of usually small, usually nocturnal lizards. 
      <br> They are found on every continent except Antarctica. 
   </p>
</body>
</html>

Example : Poem Formatting

Consider the following example, where we are going to format each line of the code using the <br> tag.

<!DOCTYPE html>
<html>
<body style="text-align:center">
<p><b>I'm A Little Spider</b><br>I'm a little spider,<br>watch me spin.<br>If you'll be my dinner.<br>I'll let you come in.</p>
</body>
</html>

Example : Address Formatting

In the following example, we are going to use the <br> tag for formatting the address.

<!DOCTYPE html>
<html>
<body style="text-align:center">
<p>Kavuri incore9<br>4th Floor TutorialsPoint<br>Madhapur, Hyderabad</p>
</body>
</html>

Supported Browsers

Tag Chrome Edge Firefox Safari Opera
br Yes Yes Yes Yes Yes
html_tags_reference.htm
Advertisements