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

Do your career a big favor. Join DEV. (The website you're on right now)

It takes one minute, it's free, and is worth it for your career.

Get started

Community matters

Top comments (0)

👋 Kindness is contagious

Discover a treasure trove of wisdom within this insightful piece, highly respected in the nurturing DEV Community enviroment. Developers, whether novice or expert, are encouraged to participate and add to our shared knowledge basin.

A simple "thank you" can illuminate someone's day. Express your appreciation in the comments section!

On DEV, sharing ideas smoothens our journey and strengthens our community ties. Learn something useful? Offering a quick thanks to the author is deeply appreciated.

Okay