why we use forward slash with br tag
Hi. I've seen this practice in video tutorials as well as on online website that in single tags like br, a forward slash is used with it like this:
<br />
Why do we used this forward slash, is it since old versions or its only in new versions of html?
Re: why we use forward slash with br tag
Re: why we use forward slash with br tag
In XML, <x/> is equivalent to <x></x>.
In HTML, the br element has no closing tag, so only <br> is necessary. However, people often write <br /> for readability's sake, and for consistency with XML, which always requires closing tags.
Re: why we use forward slash with br tag
It's also to maintain standards with XHTML doc formats.
-tg
Re: why we use forward slash with br tag
Thank you very much all of you my teachers and brothers.
One more related thing which i asked in my question as well, that has it always been a practice to put forward slash with br <br /> or its a new practice?
Re: why we use forward slash with br tag
No, it hasn't always been that way but it isn't new either: I've been doing that for 10+ years...
-tg