The <br> tag is also known a line breaking tag. The HTML <br> tag produces a single line break.It means the text/image use the <br> tag will be moved to the next line. It is useful for writing a poem or an address or giving gap. we should not use <br> tag to increase the more gap between lines of text; use the CSS margin property or the <p> tag.
The <br> tag is an empty tag ,it has no end tag.We can make a line break without changing paragraph by using br tag,that is also important use of line break tag. The line break tag is the <br> tag in HTML and <br/> in XHTML.

You can understand use of <br> tag by a simple example:-

e.g.

<!DOCTYPE html>
<html>
<body>
<p>
This is first line.<br/>above it we use br tag. </p>
</body>
</html>


Result:-

This is first line.
above it we use br tag.



The following attributes can be set for the <br> tag:-

<br> Tag Attributes

<br clear="none|left|right|all">

Attribute Value Discription
clear none It is default value which causes the new line,start below the current line.
left cause the new line to start below images or objects floated on the left.
right cause the new line to start below images or objects floated on the right.
all cause the new line to start below images and objects floated on the left and right.


Example:-

<!DOCTYPE>
<html>
<head>
<title>HTML Test</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf- 8">
</head>
<body>
<p>
This is before the br tag.
</p>
<p>This is before the br tag.<br>This is after the br tag.<br clear="center">
This is after the br tag using the clear attribute.</p>
</body>
</html>

Result:-

This is before the br tag.

This is before the br tag.
This is after the br tag.
This is after the br tag using the clear attribute.



Use of   &nbsp;  :-
Defines single space beween text.Generally when we want to give multiple or large space we use many &nbsp; .Just like we want to make space equal to ten characters we use it ten times.

e.g.
<p>Hindi is National &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Language of india. </p>

Result:-

Hindi is National       Language of india.



Conclusion:--

So the <br> tag use to insert a single line break in paragrapgh or text.

<br> tag का उपयोग पैराग्राफ को चेंज किये बिना ही नई लाइन से text आरम्भ करने के लिए करते है <br> tag को line breakin tag के नाम से भी जाना जाता है इसका उपयोग addres ,poem ,और gap देने के लिए किया जाता है जब हमें ज्यादा gap देना हो तो margin का उपयोग करना चाहिए इसके use और उपयोग करने का तरीका आप ऊपर दिए गए example से समझ सकते है

2 comments: