how do you “create a line break in HTML”

1 answer

In HTML, you can create a line break by using the <br> tag. This tag is an empty (self-closing) element, meaning it does not require a closing tag. Here’s how you can use it:

<p>This is the first line.<br>This is the second line.</p>

In this example, the text "This is the first line." will be on one line, and "This is the second line." will appear directly below it, due to the <br> tag creating a line break.

Remember that the <br> tag is often used for line breaks in plain text or poetry, but for structuring content, it is generally recommended to use block elements like <p> for paragraphs, which provides better semantic meaning and accessibility.