View Full Version : Close Tags!
techietim
12-20-2006, 04:03 PM
Lots of you know how to close tags like:
<p>
Content
</p>
But you should also close single tags to make sure your HTML is valid:
Wrong:
<hr>
<br>
Right
<hr />
<br />
:rolleyes:
DragoNero
12-20-2006, 05:50 PM
i hate i hate i hate that.... i have to do that just for validation and it annoys me! otherwise im too lazy to do it =/
techietim
12-20-2006, 05:51 PM
The internet is so strict :p
fenderocker
12-20-2006, 05:52 PM
actually, It's not required for HTML validation(at least loose) and it's only required for XHTML validation
Corruption
12-21-2006, 05:37 AM
^ Exactly. Those kind of closure tags are XHTML, not normal HTML. And I think it can be bad if you mix them both together in a page.
DragoNero
12-21-2006, 07:12 AM
actually they are needed for proper html validation too.... but often they just decide not to include them in validation because no1 can be bothered to type " /"
techietim
12-21-2006, 07:18 AM
Only I bother :p Once you get use to it, its easy. Its a good habit to get into aswel
DragoNero
12-21-2006, 08:50 AM
yer but still... im too lazy lol
PigFeed
03-11-2007, 04:15 PM
I never do it, and everything comes put fine...
That is actually incorrect HTML, though unfortuanetly the W3C validator doesn't catch this. However, you must close these empty tags with XHTML only. If you do this with any current version of HTML, you are not using correct code.
vBulletin® v3.8.4, Copyright ©2000-2010, Jelsoft Enterprises Ltd.