Computer Forums

Member Login

Remember Me? Sign Up! | Forgot Password
 
Slogan
 
Computer Forums > Programmers Lounge > Programming Discussions » Optional Closing Tags in HTML
Closed Thread
Old 10-05-2007, 03:13 AM   #1 (permalink)
 
Banned

Join Date: Aug 2007

Posts: 6

komlom is on a distinguished road

Default Optional Closing Tags in HTML

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?
Reply With Quote
_________________
water fountain construction Suchmaschinen-Optimierung
komlom is offline  
Old 10-05-2007, 02:44 PM   #2 (permalink)
CrazeD's Avatar
 
Wizard Techie

Join Date: Feb 2006

Location: Maine

Posts: 3,683

CrazeD will become famous soon enough

Send a message via AIM to CrazeD Send a message via MSN to CrazeD
Default Re: Optional Closing Tags in HTML

Heh...I never knew that either.

I would close it anyway though, just because it seems proper to close all tags.
__________________

Need website help? PM me!
CrazeD is offline  
Old 10-05-2007, 02:51 PM   #3 (permalink)
 
Junior Techie

Join Date: Oct 2007

Location: Off the grid.

Posts: 92

ReikokuKo is on a distinguished road

Send a message via AIM to ReikokuKo
Default Re: Optional Closing Tags in HTML

This is very interesting. Have you found any other tags that don't need to be closed?
ReikokuKo is offline  
Old 10-05-2007, 02:52 PM   #4 (permalink)
 
Junior Techie

Join Date: Oct 2007

Location: Off the grid.

Posts: 92

ReikokuKo is on a distinguished road

Send a message via AIM to ReikokuKo
Default Re: Optional Closing Tags in HTML

Hold on, so you don't close the </head> and just start <body>?

I would imagine that it would start the <body> within in the <head> and I don't much about PHP but maybe when you call up a header in PHP, it will call up whatever you have in <head> which will then include all your contents in <body>
ReikokuKo is offline  
Old 10-05-2007, 05:44 PM   #5 (permalink)
CrazeD's Avatar
 
Wizard Techie

Join Date: Feb 2006

Location: Maine

Posts: 3,683

CrazeD will become famous soon enough

Send a message via AIM to CrazeD Send a message via MSN to CrazeD
Default Re: Optional Closing Tags in HTML

Quote:
Originally Posted by ReikokuKo View Post
Hold on, so you don't close the </head> and just start <body>?

I would imagine that it would start the <body> within in the <head> and I don't much about PHP but maybe when you call up a header in PHP, it will call up whatever you have in <head> which will then include all your contents in <body>
PHP is parsed before HTML, so, no it won't.
__________________

Need website help? PM me!
CrazeD is offline  
Old 10-05-2007, 05:46 PM   #6 (permalink)
 
Junior Techie

Join Date: Oct 2007

Location: Off the grid.

Posts: 92

ReikokuKo is on a distinguished road

Send a message via AIM to ReikokuKo
Default Re: Optional Closing Tags in HTML

Awesome.
ReikokuKo is offline  
Old 10-08-2007, 12:55 AM   #7 (permalink)
 
Monster Techie

Join Date: May 2004

Location: /usr/root/mn/us

Posts: 1,121

bla!! is on a distinguished road

Default Re: Optional Closing Tags in HTML

It won't pass any of the HTML validators if you don't close them all.

Check out W3C's HTML validator which is very commonly used.
__________________
<br>
Its a frigging Laptop, not a Labtop!!!!
bla!! is offline  
Old 10-08-2007, 10:14 AM   #8 (permalink)
CrazeD's Avatar
 
Wizard Techie

Join Date: Feb 2006

Location: Maine

Posts: 3,683

CrazeD will become famous soon enough

Send a message via AIM to CrazeD Send a message via MSN to CrazeD
Default Re: Optional Closing Tags in HTML

Quote:
Originally Posted by bla!! View Post
It won't pass any of the HTML validators if you don't close them all.

Check out W3C's HTML validator which is very commonly used.
He's saying it DID validate without closing the head.
__________________

Need website help? PM me!
CrazeD is offline  
 
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Allowing HTML in PHP/MySQL posts? thejeremy Programming Discussions 1 06-25-2007 02:49 PM
Just heard of Dreamweaver cs3. Replacement for html and css? stainer711 Web Graphics, Design, Digital Images 17 06-19-2007 08:27 AM
ID3 v2.3 tags incorperating album art Trifid Windows Operating Systems and Software 1 04-30-2007 01:54 PM