Tarea anterior
Marcado de texto con HTML9/10
A la lista de tareas
  1. 1. Párrafos
  2. 2. Encabezados y subencabezados
  3. 3. Lista no ordenada
  4. 4. Lista ordenada
  5. 5. Lista multinivel
  6. 6. Lista de definiciones
  7. 7. Importancia: etiquetas strong y b
  8. 8. Destacar información: etiquetas em e i
  9. 9. Saltos de línea y separadores: etiquetas br y hr
  10. 10. Texto preformateado
Siguiente tarea
  • Cursos
  • Registro
  • Iniciar sesión

Loading…
En unos segundos, estará listo.

  • Teoría
  • Teoría

Saltos de línea y separadores: etiquetas br y hr

A veces hace falta insertar un salto de línea dentro de un texto sin crear un párrafo nuevo. Pasa, por ejemplo, al marcar poemas o letras de canciones.

Para eso HTML tiene la etiqueta vacía <br>.

A veces esta etiqueta se usa para dividir un texto en «párrafos improvisados», pero no es una buena práctica. Para marcar párrafos usa la etiqueta <p>.

La etiqueta vacía <hr> se usa para crear una línea divisoria horizontal. Su aspecto se puede modificar con atributos, aunque lo más correcto es hacerlo con CSS.

  • index.html
HTML
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Saltos de línea y separadores</title> </head> <body> <h1>Ring-verse</h1> <p> Three Rings for the Elven-kings under the sky, Seven for the Dwarf-lords in their halls of stone, Nine for Mortal Men doomed to die, One for the Dark Lord on his dark throne In the Land of Mordor where the Shadows lie. </p> <p> One Ring to rule them all, One Ring to find them, One Ring to bring them all, and in the darkness bind them In the Land of Mordor where the Shadows lie. </p> </body> </html>

El código ha cambiado, haz clic en "Actualizar" o activa la ejecución automática.

Ha ido a otra página

Haga clic dentro del mininavegador para poner el foco en esta ventana.

100%
ObjetivosRealizado
0
    1. Con la etiqueta <br>, agrega cuatro saltos de línea al primer párrafo.
    2. Agrega dos saltos de línea al segundo párrafo.
    3. Añade separadores entre los párrafos con la etiqueta <hr>.

    © 2023-2026, codigoheroe.com