What's the difference between <br> and <br /> ?

+1 vote
asked Jul 10, 2017 by fingerlickingchickin (130 points)

1 Answer

0 votes

<br> is HTML

<br /> is XHTML

When using HTML validation service such as validator.w3.org it all depens on what <!doctype ... >  you are using on to of your html file. 

You'll get errors if you use and XHTML doctype and have <br> tags.

If it is HTML 4 or HTML5 doctype you shouldn't recieve any errors if you use <br>.

answered Jul 12, 2017 by Lovecode (640 points)
Lovecode logo