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

Top comments (0)

AWS Security LIVE!

Tune in for AWS Security LIVE!

Join AWS Security LIVE! for expert insights and actionable tips to protect your organization and keep security teams prepared.

Learn More

👋 Kindness is contagious

Dive into an ocean of knowledge with this thought-provoking post, revered deeply within the supportive DEV Community. Developers of all levels are welcome to join and enhance our collective intelligence.

Saying a simple "thank you" can brighten someone's day. Share your gratitude in the comments below!

On DEV, sharing ideas eases our path and fortifies our community connections. Found this helpful? Sending a quick thanks to the author can be profoundly valued.

Okay