+ 1

why do I need <br />

why do I need <br /> in the flowing? <table border="2"> <tr> <td>Red</td> <td>Blue</td> <td>Green</td> </tr> <tr> <td><br /></td> <td colspan="2"><br /></td> </tr> </table>

21st May 2020, 6:01 PM
Michael Hong
Michael Hong - avatar
4 ответов
+ 1
In HTML, the <br> tag is used for line break. It is an empty tag i.e. no need to add an end tag. Writing <br> tag is perfectly fine. Let’s see the usage of other br tags i.e. <br/> or <br />, In HTML, use <br> tag. In XHTML, the valid way is to use <br/> or <br></br> as mentioned in the XHTML guidelines.(https://www.w3.org/TR/xhtml1/#h-4.6) According to w3 guidelines,(https://www.w3.org/TR/xhtml1/#guidelines) a space should be included before the trailing / and > of empty elements, for example, <br />. These guidelines are for XHTML documents to render on existing HTML user agents.
22nd May 2020, 7:41 AM
Riotam Khan
Riotam Khan - avatar
0
looks same to me with or without <br />
21st May 2020, 6:43 PM
Michael Hong
Michael Hong - avatar
0
<br/> means line break.
21st May 2020, 7:38 PM
Samira
Samira - avatar