DEV Community

Cover image for HTML tags | br
Carlos Espada
Carlos Espada

Posted on • Edited on

1

HTML tags | br

It is used to introduce a line break in a text. It is useful for writing addresses or poems, for example, where line division is important.

You do not have to use it to create space between texts, for this you have to use different <p> and control the margin with CSS. Separating paragraphs using <br>, in addition to being a bad practice, can pose a problem for screen reader users by causing a confusing and frustrating experience when advertising content.

Being a tag with such a specific purpose, it has no dimensions or visual output in the browser, so there is little that can be done to style it. margin could be used to increase the space between lines of the text but it's bad practice, that's what the CSS line-height exists for.

It can be written as <br> or as <br />.

  • Type: inline
  • Self-closing: Yes
  • Semantic value: No

Definition and example | Support

Heroku

Simplify your DevOps and maximize your time.

Since 2007, Heroku has been the go-to platform for developers as it monitors uptime, performance, and infrastructure concerns, allowing you to focus on writing code.

Learn More

Top comments (0)

Billboard image

Create up to 10 Postgres Databases on Neon's free plan.

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Try Neon for Free →