Welcome, Guest
  • Author Topic: Optional Closing Tags in HTML  (Read 2637 times)

    tharanga2

    • Server what's that
    • *
    • Posts: 3
      • View Profile
      • Email
    Optional Closing Tags in HTML
    « on: 06/15/09, 02:41 »
    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?   
    ______________
    musicals tickets
    Sport betting 365
                   
                   

    Jorge Solis

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 14616
      • View Profile
    Re: Optional Closing Tags in HTML
    « Reply #1 on: 06/15/09, 06:41 »
    AFAIK closing tags are non optional but a must for well formed document. Most of the modern browsers could display a page whitout closing tags, but well formess validation force it. Don't know if this change in latest specifications

    Jorge

    Ronald Wernecke

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 6203
      • View Profile
      • Professional Support
      • Email
    Re: Optional Closing Tags in HTML
    « Reply #2 on: 06/15/09, 10:38 »
    Ok, maybe you can omit the last </html> or </body>.
    But how would a browser handle a <b>, if there is no closing tag? It would make the rest bold.
    The same with the <head> tag.
    If there is no </head> the complete document is a header.
    This makes no sense.
    Our goal should allways be writing clean code.
    happy flashing
    8)
    Ronald