Please tell me sir.which tag used for line break than <br> tag in html only | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Please tell me sir.which tag used for line break than <br> tag in html only

22nd Jul 2017, 3:34 AM
Sandeep Chidurala
Sandeep Chidurala - avatar
3 Answers
+ 4
there is only one tag in HTML5 that adds line break( is there another one ? ) <br> . which can also be written as <br> <br /> <br/>(last two used in xhtml). there is a similar tag which adds a horizontal break-line <hr>. the <p> tag starts a new paragraph with space https://code.sololearn.com/W9or0EQuF7gF/?ref=app
22nd Jul 2017, 4:06 AM
Lord Krishna
Lord Krishna - avatar
+ 3
@Lord Krisha: There's only one valid Html5 to write break line element: <br>, even if unvalid are auto-corrected by browsers :P Any empty block element can be used to insert break line, because of their behaviour (breaking the content stream, unlike inlined block)... so does the <hr> special one (necessarly empty, as <br>). Another way of displaying/using break line is to use 'normal' one with not usual Html behaviour (default ignore break line char and convert them to space) by embeding text with break lines inside a <pre> element (or giving a 'pre' value to the 'white-space' css property): <pre>This is a special text: It will be respectuous of line breaks ;)</pre>
22nd Jul 2017, 7:56 AM
visph
visph - avatar
+ 1
Depending on your text and required formatting determines how often you use <br>. I find I ts uses bed in block text that receives the same text treatment and needs to be tightly spaced. Great examples of this are addresses, and signature lines.
22nd Jul 2017, 5:22 AM
Jim Tully
Jim Tully - avatar