Line Break in html pages using <br> tag
This is first Line
This is first Line<br>This is second line
This is second line
Line breaks in html pages can be given by using <br> tag. It does not have any end tags and it can be used at any place within the body tags of the page.
Inside table cells and other simple areas also we can use line break tag <br>. More than one break tags can be used to give more line breaks. We will discuss here simple html line breaks and its uses.
The output is here
This is line one <br>This is line two after one line break<br><br>line three after two line breaks<br>
This is line one
This is line two after one line break
line three after two line breaks
<pre> tag and line breaks
Within <pre> tags there is no need to give extra line breaks. The text will be displayed along with its line breaks.
In a text area if you are using any line breaks then it does not convert on its own to line breaks in html pages. As a result of this many time you will find posting by users or after the form is submitted the page get stretched horizontally without any line breaks. There are different ways to convert the line breaks in html pages, you can see php example of converting line breaks for html web pages.
HTML Paragraph in HTML pages
This article is written by plus2net.com team.