The <br> Element in HTML

The <br> element is used to create a line break in text. Unlike paragraphs, which create space above and below text, the <br> tag simply moves the content to the next line.

br element - Educodes

Think of <br> like pressing Enter once in a text editor — it does not add extra spacing like a <p> tag does.

The <br> tag is especially useful for:

  • Writing addresses
  • Breaking lines in poems or song lyrics
  • Making text appear on the next line without starting a new paragraph

The <br> tag is self-closing, which means it does not need a closing tag.

Understaning the layout of the <br> Element

Start tagElement contentEnd tag
<br>nonenone

Note: Some HTML elements have no content (like the <br> element). These elements are called empty elements. Empty elements do not have an end tag!

📘 Example Code

Below is an HTML example showing how <br> creates a new line inside text:

💡 This is what the code looks like inside an editor

<!DOCTYPE html> <html> <head> <title>Line Break Example</title> </head> <body> <h1>My Travel Blog</h1> <p>Welcome to my travel page!<br>Here you will find great travel tips and stories.</p> </body> </html>

🖥️ What This Will Look Like in a Browser

✅ Example output you would see on a webpage:

Welcome to my travel page!
Here you will find great travel tips and stories.

🧪 Time to Practise!

Now it’s your turn to create your own line break using the <br> element.

Try this example first:

<p>Learning HTML is fun!<br>I can create websites!</p>

What To Do

✅ Type the code above in the editor below
✅ Click Test Code to see the result
✅ Try changing the sentence and adding more <br> tags
✅ Test how it changes your text formatting

Tip 💡

Use <br> for quick line breaks, but use <p> for full paragraphs — it keeps your code clean and professional.
The more you practise, the more natural HTML layout and formatting will feel. 🚀

HTML Editor

Live Preview

Continue with the next lesson on using the <hr> tag to divide sections in HTML.

Educodes Logo

© Copyright 2024. | Educodes