Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Status Updates

View All Updates

Photo
- - - - -

Optional Closing Tags in HTML

HTML

  • Please log in to reply
18 replies to this topic

#1 Big Mountain

Big Mountain

    CC Lurker

  • Just Joined
  • Pip
  • 3 posts

Posted 04 February 2008 - 02:05 PM

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?
  • 0

#2 John

John

    CC Mentor

  • Moderator
  • 4450 posts
  • Location:New York, NY

Posted 04 February 2008 - 10:50 PM

I find it hard to believe that not closing your head tag is XHTML compliant.
  • 0

#3 WingedPanther73

WingedPanther73

    A spammer's worst nightmare

  • Moderator
  • 17757 posts
  • Location:Upstate, South Carolina
  • Programming Language:C, C++, PL/SQL, Delphi/Object Pascal, Pascal, Transact-SQL, Others
  • Learning:Java, C#, PHP, JavaScript, Lisp, Fortran, Haskell, Others

Posted 05 February 2008 - 10:00 AM

As people move towards using XHTML instead of HTML, the closing tags will stop being optional.
  • 0

Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

My MineCraft server site: http://banishedwings.enjin.com/


#4 Guest_Jordan_*

Guest_Jordan_*
  • Guest

Posted 05 February 2008 - 01:03 PM

I did not know this either and it seems against standards.
  • 0

#5 Gabriel

Gabriel

    CC Regular

  • Just Joined
  • PipPipPip
  • 37 posts

Posted 08 February 2008 - 01:15 PM

why would they put it in as opptional in the first place? Would they do that in order to entice people to use it? I mean with out closing tagss it would "seem" alot easier.
  • 0

#6 TcM

TcM

    CC Mentor

  • VIP Member
  • PipPipPipPipPipPipPipPip
  • 7563 posts

Posted 13 February 2008 - 10:37 AM

Well I don't know what you mean by optional, it's either that the webpage will be still displayed correctly, or it is with the standards....
  • 0

#7 Rothzael

Rothzael

    CC Regular

  • Just Joined
  • PipPipPip
  • 25 posts

Posted 25 February 2008 - 06:32 AM

If you want valid markup, you should close the tags.
  • 0

#8 xXHalfSliceXx

xXHalfSliceXx

    CC Leader

  • Retired Mod
  • PipPipPipPipPipPipPip
  • 1561 posts

Posted 26 February 2008 - 09:36 PM

Duplicate post.....

http://forum.codecal...-tags-html.html

Looks like Promotion of Rothzael's signature,

Which looks like a free service.
  • 0

Posted Image
Posted Image


#9 Rothzael

Rothzael

    CC Regular

  • Just Joined
  • PipPipPip
  • 25 posts

Posted 26 February 2008 - 10:15 PM

Duplicate post.....

http://forum.codecal...-tags-html.html

Looks like Promotion of Rothzael's signature,

Which looks like a free service.


Um, sorry. I posted in that thread, then realised that the thread was a duplicate and everyone was actually posting in this one.
  • 0

#10 chili5

chili5

    CC Mentor

  • Expert Member
  • PipPipPipPipPipPipPipPip
  • 3038 posts
  • Programming Language:Java, C#, PHP, JavaScript, Ruby, Transact-SQL
  • Learning:C, Java, C++, C#, PHP, JavaScript, Ruby, Transact-SQL, Assembly, Scheme, Haskell, Others

Posted 13 March 2008 - 10:35 AM

wow I didn't know that I was always taught to close head tag.

I thought that it was always required since the beginning of HTML.
  • 0

#11 TcM

TcM

    CC Mentor

  • VIP Member
  • PipPipPipPipPipPipPipPip
  • 7563 posts

Posted 22 March 2008 - 07:44 AM

It Is required, if you really want a 100% valid page you should close each and every opened tag
  • 0

#12 Guest_Kaabi_*

Guest_Kaabi_*
  • Guest

Posted 05 May 2008 - 04:46 PM

I'm pretty sure the <head> tag definitely needs closing. I'm pretty certain that the initial <html> isn't needed either, or if it is, </html> definitely isn't.
  • 0





Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download