Skip to content
Related Articles

Related Articles

HTML <br> Tag

View Discussion
Improve Article
Save Article
  • Difficulty Level : Easy
  • Last Updated : 17 Mar, 2022

In this article, we will know how to add line-break using HTML <br> tag. The browser does not recognize new line and paragraph formatting in the text. If you want to start a new line, you need to insert a line break with the help of the <br>. The <br> tag inserts a single carriage return or breaks in the document. This element has no end tag.

Example: In this example, we use <br> tag in p tag to line break the content.

HTML




<!DOCTYPE html>
<html>
  
<body>
    <h2>GeeksforGeeks</h2>
    
    <!--br tag is used in below paragraph-->
      
<p>Hi Geeks! <br>Welcome to GeeksforGeeks</p>
  
</body>
  
</html>

Output:

HTML <br> tag

Let us consider an example. Type the following HTML code does not use the <BR> tag in notepad, save the document as an HTML file, and open it in a browser. You will notice that the text shows line breaks at four instances, the browser displays the entire text as a single paragraph.

Syntax:

<br>

Attributes: This tag accepts an attribute called clear

  • clear: Indicates where to begin the next line after the break.

Example: This example explains the use of the <br> tag to add the line-breake.

HTML




<!DOCTYPE html>
<html>
  
<body>
    <h1>GeeksforGeeks</h1>
    <h2>br Tag</h2>
      
    <!-- br tag -->
    <p>GeeksforGeeks:
        <br> Computer science portal</p>
  
</body>
  
</html>

Output:

HTML <br> tag

Supported Browsers: 

  • Google Chrome 1 and above
  • Microsoft Edge 12 and above
  • Internet Explorer
  • Firefox 1 and above
  • Safari
  • Opera

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!