How to set a single line break in HTML5 ?

In this article, we will add a single line break using the <br> tag. It s used to give the single line break. It is the empty tag so it does not contain end tag.

Syntax:

<br>

Example 1: This example uses <br> tag to break the line.

filter_none

edit
close

play_arrow

link
brightness_4
code

<!DOCTYPE html>
<html>
  
<head>
    <title>
        How to defines a 
        single line break?
    </title>
  
    <style>
        body {
            text-align: center;
        }
  
        h1 {
            color: green;
        }
    </style>
</head>
  
<body>
    <h1>GeeksforGeeks</h1>
  
    <h2>
        HTML5: How to defines 
        a single line break?
    </h2>
  
    <!-- br tag is used here -->
    <p>
        GeeksforGeeks: <br
        Computer science portal
    </p>
</body>
  
</html>              

chevron_right


Output:

Example 2: This example uses br class to break the line.

filter_none

edit
close

play_arrow

link
brightness_4
code

<!DOCTYPE html>
<html>
  
<head>
    <title>
        How to defines a 
        single line break?
    </title>
  
    <style type="text/css">
        .br {
            display: block;
            margin-bottom: 0em;
        }
  
        .brsmall {
            display: block;
            margin-bottom: -.2em;
        }
  
        .brxsmall {
            display: block;
            margin-bottom: -.4em;
        }
    </style>
</head>
  
<body>
    <h2>GeeksForGeeks</h2>
  
    <h2>
        HTML5: How to defines 
        a single line break?
    </h2>
  
    <h4>
        This page shows different
        break height between
    </h4>
  
    <p>Hi User
        <span class="br"></span>
        Welcome to
        <span class="brsmall"></span>
        Geeks for geeks.
        <span class="brxsmall"></span>
        Hope you have enjoyed your stay.
    </p>
</body>
  
</html>        

chevron_right


Output:

full-stack-img




My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.