×

Line Breaks and Separators: br and hr tags [10/17]

Sometimes you may need to insert a line break without creating a paragraph. This might be helpful to mark up poetry or lyrics.

For this purpose, HTML offers a singular tag, <br>.

Some people use it to format their text into "sort of paragraphs". However, this is considered a poor practice. So make sure you use the <p> tag for paragraphs.

Another singular tag is <hr>. It introduces a horizontal rule to separate sections of text. Although you can style this rule with attributes, it is better to use CSS for this (you will learn it in the next courses).


Do it
HTML
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Line Breaks and Separators</title> </head> <body> <h1>The Mouse's Tale (from Lewis Carroll's original version of "Alice's Adventures in Wonderland")</h1> <p> We lived beneath the mat, Warm and snug and fat, But one woe, and that Was the Cat! </p> <p> To our joys a clog, In our eyes a fog, On your hearts a log, Was the Dog!</p> <p> When the Cat’s away, Then the mice will play, But alas! one day, (So they say)... </p> </body> </html>
CSS
HTML Academy
  1. Using the br tag, add 3 line breaks into the first verse,
  2. 3 line breaks to the second verse,
  3. and 3 line breaks to the third verse.
  4. Add separators between verses using the hr tag.
Theory Check Next