PDA

View Full Version : Optional Closing Tags in HTML



Carrym
March 20th, 2007, 05:50 AM
For as long as I've been validating web pages, I never realized that the closing </head> tag was optional in HTML. I feel as if I've missed the boat at times. ;)

While I'm all for trimming excess code, I just cannot for the life of me strip out closing tags because they are optional in HTML. I'd be concerned that something, somewhere would not parse the document correctly if I removed the closing </head> element.

Are my concerns unfounded?

kBisk
March 20th, 2007, 05:11 PM
i agree, there is no reason to remove any closing tags like </head>, especially when considering validation and code structure.

bwh2
March 20th, 2007, 05:18 PM
just because a particular browser will still render pages if closing tags are omitted does not mean the closing tags are optional in terms of being syntactically correct.

evildrummer
March 20th, 2007, 05:26 PM
No tags should go unended, that is final, all HTML tags should either have theyre own:


<tag></tag>

or


<tag />

brndn
March 20th, 2007, 07:13 PM
closing all tags is good practice. The amount of times I have had glitches occur due to one tag being unclosed or incorrectly closed, its not worth the pain really.:+)