HTML Basics: HTML line break

Tabla de contenidos

An line break in HTML is made by using the <br> or <br/>tag. This is used to introduce a html new line in the text, similar to using the “Enter” key on the keyboard. 

They are generally used within paragraphs and are very useful when writing addresses or any other texts where line separation is important. 

However, it’s not necessary to introduce line breaks in between paragraphs, since using the <p> tag does this. On the other hand, neither is it necessary to use them to increase the size of the line break in HTML. To do this, it’s better to change the CSS margin of the document. 

HTML line break features

  • A closing tag isn’t necessary. The only vital thing is adding the <br> tag at the end of the line where you want a break. In other words, it’s an empty element.
  • In XHTML it’s written as <br/>
  • Line break tags come under the “phrasing content” category, which in turn is a subset of the “flow content” category.
  • They enable any element that accepts “phrasing content” as a parent element.
  • The <br> tag includes global attributes. However, from HTML 4.01 onwards, the lang and dir attributes aren’t compatible with it. 

An example of how to make an HTML line break

Epitech Barcelona Campus<br>

Address: C/ Joan Miró, 21 Barcelona (08005)<br>

Tel: + (34) 93 797 88 14<br>

Email:<br>

[email protected]

As you can see, line space tags in HTML are very useful and easy to introduce. If you want to learn more, don’t hesitate to study at EPITECH. We offer a Bachelor + Master’s Degree in Computer Science where you’ll learn all about programming languages.

EPITECH y la "Visa du MESR": ¿Qué ha pasado en 2024?
EPITECH ha obtenido la “Visa” du MESR (Ministère de l’Enseignement Supérieur et de la Recherche) Esto...
Cómo empezar en ciberseguridad: la guía definitiva
¿Por qué formarte en ciberseguridad? La ciberseguridad se ha convertido en uno de los sectores más demandados...
El robot para personas mayores contra la soledad ARKEO
Un estudiante de Epitech Barcelona impulsa un robot para combatir la soledad de las personas mayores...
¿Necesito hacer Selectividad para ser desarrollador de software?
Cuando pensamos en estudiar para convertirnos en desarrolladores de software, programadores o estudiar...
5 proyectos tech que puedes crear antes de cumplir 20
5 proyectos tech que puedes crear antes de cumplir 20 ¿Tienes entre 15 y 20 años y te apasiona la tecnología,...