HTML
Tag

HTMLWeb DevelopmentFront End Technology

The <br> tag in HTML is used to set a single enter line break. Let us now see an example to implement the br tag in HTML −

Example

 Live Demo

<!DOCTYPE html>
<html>
<body>
   <h2>Demo Heading</h2>
   <p>This is a demo text! The next paragraph will appear after two line breaks.</p> <br><br>
   <p>We have set a demo paragraph here. We have set a demo paragraph here. We have set a demo
   paragraph here. We have set a demo paragraph here. We have set a demo paragraph here. We have
   set a demo paragraph here. The next line will appear after a single line break.</p><br>
   <p>This is a demo text!</p>
</body>
</html>

Output

In the above example, we have used <br> tag. Two line breaks are set here for the next paragraph using the <br> tag twice −

<p>This is a demo text! The next paragraph will appear after two line breaks.</p> <br><br>

Now, only a single break is set for the next line using the <br> tag only once −

<p>We have set a demo paragraph here. We have set a demo paragraph here. We have set a demo paragraph here. We have set a demo paragraph here. We have set a demo paragraph here. We have set a demo paragraph here. The next line will appear after a single line break.</p><br>
<p>This is a demo text!</p>
raja
Updated on 29-Jun-2020 09:01:49

Advertisements