Forum Moderators: coopster
<br> becomes <br />
Can someone tell me the reason this is needed, and whether it applies to ALL HTML tags? For example, what about these:
<a href="page.htm" />link</a />
<font class="big" />text</font />
<form />
<input type="submit" value="Pay" name="submit" />
</form />
When (and why) is it needed, and when (if ever, not)?
So the /> is just the end of the tag. If you are using an HTML doctype then you shouldnt use /> as this in invalid, however if you are using XHTML then you will get validation errors if you dont close the tags properly.
There should be a space after the final letter in the tag then /> as some browsers choke on <br/> all are fine with <br />, but only if you are using XHTML.
A lot of my code has that and it seems to work properly. Am I just lucky...so far?!
This is my doc header; I assume this is HTML, not XML:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
That is an HTML doctype so you are fine.