Optional Closing Tags in HTML

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Zemfik
    Junior Member
    • Mar 2008
    • 1

    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?
  • Kuruk
    Junior Member
    • Jul 2008
    • 9

    #2
    Hi


    For convenience and in order to allow for additional bits or bytes being saved in your markup, here’s a list of all optional tags according to the HTML 4.01 Strict DTD. Finally, as even nine years after release of the HTML 4 specification, there still seems to be no list like this.
    * </area>
    * </base>
    * <body>
    * </body>
    * </br>
    * </col>
    * </colgroup>
    * </dd>
    * </dt>
    * <head>
    * </head>
    * </hr>
    * <html>
    * </html>
    * </img>
    * </input>
    * </li>
    * </link>
    * </meta>
    * </option>
    * </p>
    * </param>
    * <tbody>
    * </tbody>
    * </td>
    * </tfoot>
    * </th>
    * </thead>
    * </tr>

    These are in fact tags, not elements, and for some this list might explain the simplicity of the supposedly best HTML template. However, thanks to Rupert for inspiring me to compile such a list. read more

    thanks

    Comment

    • Guest

      #3
      </br> </hr> is wrong.
      that are not closing tag. right is <br> <hr>

      Comment

      • stevex
        Member
        • Apr 2014
        • 74

        #4
        There are some tags which are optional closing.but my habit is to close every tag because of my convenience to remember each tag what i have used.

        Comment

        Working...