DEV Community

Cover image for HTML tags | br
Carlos Espada
Carlos Espada

Posted on • Updated on

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

Latest comments (0)