Contact Our Development Team
Free Code Tutorials & Open Source Code
HTML Line Breaks
Tutorials > HTML > Line Breaks
HTML Line Breaks
In the previous tutorial, we introduced the <br /> tag. This is the first time we have demonstrated tags which do not have a closing tag. For some tags, like line breaks, it doesn't make sense to have a closing tag, as there is no way they can wrap around content. However, in order to have a well-formed document each tag must close. the /> at the end of the tag indicates that this is a singular tag which has closed. See the example below for how the <br /> works.
<p>
This text
will display
all on one line
because line returns in the content
don't automatically provide a line break in the display
</p>
<p>
This text <br />
will display <br />
across many lines <br />
as we have added line break tags.
</p>

This text will display all on one line because line returns in the content don't automatically provide a line break in the display

This text
will display
across many lines
as we have added line break tags.

Page Responses
Currently there have been no responses to this page...
If you have anything to contribute to this tutorial, found a bug, or know a better way of achieving the same goal, please leave your response below.
     
Copyright ©2009, Wired IDS Ltd. | Licensed under Creative Commons Attribution Share-Alike | Load time: 0.2956 seconds