What is the difference between <br> and <wbr> ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 44

What is the difference between <br> and <wbr> ?

5th Oct 2019, 6:22 PM
Aya
Aya - avatar
8 Answers
+ 32
<br> tag forces browser to put a line-break. But <wbr> defines where the browser should put a line-break if it was needed, otherwise there won't be any line-break. As said in https://www.w3schools.com/tags/tag_wbr.asp: "When a word is too long, or you are afraid that the browser will break your lines at the wrong place, you can use the <wbr> element to add word break opportunities"
5th Oct 2019, 7:20 PM
ΛM!N
ΛM!N - avatar
+ 4
The HTML <wbr> tag is used for specifying a line break opportunity. The <wbr> tag can be used on very long words or other long strings of text with no spaces. Without the <wbr> tag, these long strings of text could either wrap in strange place (making it difficult to read), or not wrap at all - inadvertently pushing the page layout to the side (again, making it difficult to read and view the document as intended). The difference between the <wbr> tag and the <br> tag is that the <br> tag forces a line break. The <wbr> tag, on the other hand, simply represents a line break opportunity - the browser should only render a line-break if necessary. The <wbr> tag is an empty tag. In other words, it has no end tag.
19th Oct 2019, 6:43 AM
Mastaan
Mastaan - avatar
+ 1
What I can remember <br> is used to break a line in html like \n in python
7th Oct 2019, 5:00 PM
Muhammad Zain
Muhammad Zain - avatar
0
lanks ska
8th Oct 2019, 2:34 AM
Lanks Ska Gravelin
Lanks Ska Gravelin - avatar
0
and
8th Oct 2019, 6:44 AM
Edson Marave
Edson Marave - avatar
0
emty element only contain ON tags.
9th Oct 2019, 1:27 PM
Amit Singh
Amit Singh - avatar
- 11
ت
6th Oct 2019, 10:12 PM
HAMADA
HAMADA - avatar
- 17
w
6th Oct 2019, 6:05 AM
Akshay Kumar
Akshay Kumar - avatar