Skip to content

HTML Line Breaks

Line breaks are a little different from the other tags mentioned so far. Line breaks can be thought of as pressing ENTER in a text editor, the cursor moves down to the start of a new line. You use the <br /> tag to create a line break.

Line breaks in HTML are also different in the fact that they can't contain any content. that is why we close them within the same tag by using a />. In the past we could just use <br> to create a line break, but since the web is moving towards XHTML, we need to use the XHTML standard of closing every tag. 

HTML Code:

My Name<br />Job Title<br />Work Phone Number

HTML Output

My Name
Job Title
Work Phone Number

As we can see everytime we used a <br /> tag, all the text after it started on a new line.

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <p><b><i><pre><a><img><em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd><h1><h2><h3><h4><h5><h6>
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.

More information about formatting options