The
<br>tag inserts a line break in text, moving content to a new line.
It is an empty (self-closing) tag and is useful for breaking lines without starting a new paragraph.
Syntax
<br>Attributes
| Attribute | Description |
|---|---|
class | Assigns one or more class names for styling. |
id | Assigns a unique identifier to the line break. |
style | Adds inline CSS styles. |
title | Provides additional information as a tooltip. |
Example
<!DOCTYPE html>
<html>
<head>
<title>BR Tag Example</title>
</head>
<body>
<h1>Line Break Example</h1>
<p>This is the first line.<br class="line-break-example">This is the second line after a break.</p>
</body>
</html>Output
Browser Output
Use our TryIt Editor to see the output.
Browser Support
Chrome | Firefox | Edge | Safari | Opera | IE9+ |
|---|---|---|---|---|---|
| ✅Yes | ✅Yes | ✅Yes | ✅Yes | ✅Yes | ✅Yes |
The <br> tag itself is invisible but forces the following content to start on a new line within the same paragraph.
Notes
<br>is self-closing; it does not require an end tag.- It is commonly used inside
<p>or other text containers to create line breaks. - Overusing
<br>instead of proper paragraphs (<p>) can lead to poor HTML structure. - Can be styled with CSS if needed using class or id attributes.
Conclusion
The <br> tag provides a simple way to insert line breaks in text content without creating new paragraphs.
It is essential for formatting text within paragraphs or other inline content.