Inserting line break in html text

Asked By 10 points N/A Posted on -
qa-featured

How can I insert a line break in formatting html paragraph?

I am confuse in using the <BR>, <PRE>, and & nbps tagline in html.

Can you help me differentiate their function?

Thanks

SHARE
Best Answer by Gideon Yasti
Best Answer
Best Answer
Answered By 15 points N/A #102107

Inserting line break in html text

qa-featured

<br> tag uses for a single line break. <br> tag is an empty tag where have no end tag.  But in XHTML, <br> tag have ending tag which is </br>. There needed to close  <br> tag by use </br> as a ending tag. <br> forces a line to break where it’s put.
Example 1 :

Techyv.com <br>
I love you <br>

Example 2

<br>Techyv.com</br>
<br> I love you </br>

Nbsp; means Non breaking space.  We can use that code for use as tab button in keyboard.

Example :

I &nbsp;&nbsp;&nbsp; Love &nbsp;&nbsp;&nbsp; You &nbsp;&nbsp;&nbsp; TechyV.com,<br>

<pre> tag means Pre Formatting Tag.  <pre> tag used for special circumstances where we want to display the text as it is typed. That’s why it called pre formatting tag.

Example :

<pre>
I love You,
     I love You,
I love You,
     I love You!
</pre>

For instance, without break tags, the following:

Answered By 0 points N/A #102108

Inserting line break in html text

qa-featured

<BR> tag in HTML is used to provide single line break, and it do not require a closing tag.

 
Example:-
 
How <BR> you
 
Result:-
 
How
 
You
 
<PRE> tag is used to display the content in the same formatting as defined in HTML code and it require a closing tag
 
Example:-
 
<PRE>A…..  B</PRE>
 
Result:-
 
A…..  B
 
&nbsp; is special tag in HTML that is used to provide 1 tab space between the words. 
 
Example-
 
A&nbsp;B
 
Result:-
 
A   B

 

Related Questions