Jump to content

Optional Closing Tags in HTML

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
18 replies to this topic

#1
Big Mountain

Big Mountain

    Newbie

  • Members
  • Pip
  • 3 posts
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?

#2
John

John

    Writes binary right handed and hex left handed

  • Moderators
  • 6,321 posts
I find it hard to believe that not closing your head tag is XHTML compliant.

#3
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
As people move towards using XHTML instead of HTML, the closing tags will stop being optional.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#4
Guest_Jordan_*

Guest_Jordan_*
  • Guests
I did not know this either and it seems against standards.

#5
Gabriel

Gabriel

    Learning Programmer

  • Members
  • PipPipPip
  • 39 posts
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.
I'm an angel. I kill firstborns while their mamas watch. I turn cities into salt. I even, when I feel like it, rip the souls from little girls, and from now till kingdom come, the only thing you can count on in your existence is never understanding why.
-
Do you know how you got that dent, in your top lip? Way back, before you were born, I told you a secret, then I put my finger there and I said "Shhhhh!"
-
Quotes taken from The Prophecy (1995)

#6
TcM

TcM

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 11,147 posts
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....

#7
Rothzael

Rothzael

    Newbie

  • Members
  • PipPip
  • 27 posts
If you want valid markup, you should close the tags.
Programming Assignment Help
while(true) { cout << "Idiot!" << endl; }

#8
xXHalfSliceXx

xXHalfSliceXx

    Speaks fluent binary

  • Moderators
  • 1,694 posts
Duplicate post.....

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

Looks like Promotion of Rothzael's signature,

Which looks like a free service.

Posted Image
Posted Image


#9
Rothzael

Rothzael

    Newbie

  • Members
  • PipPip
  • 27 posts

xXHalfSliceXx said:

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.
Programming Assignment Help
while(true) { cout << "Idiot!" << endl; }

#10
chili5

chili5

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 7,247 posts
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.

#11
TcM

TcM

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 11,147 posts
It Is required, if you really want a 100% valid page you should close each and every opened tag

#12
Guest_Kaabi_*

Guest_Kaabi_*
  • Guests
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.