[thelist] end tags?

Ian Glass iancglass at yahoo.com
Sun Apr 21 23:48:04 CDT 2002


At 02:31 PM 4/22/2002 +1000, you wrote:
>Just came across this page
>
>http://www.devx.com/projectcool/developer/reference/tag-table.html
>
>which is advising that these days we should be using end tags for all
>HTML elements, such as <img></img>, <base></base>, <input></input>...
>
>Is this page correct?

Not really.  All elements in XML (and XHTML) *do* have end tags and *must*
be closed, but you can use the shorted form instead:

   <img src="img.gif" alt="This is an Image" />
   <br />
   <input id="input" type="text" />

instead of:

   <img src="img.gif" alt="This is an Image"></img>
   <br></br>
   <input id="input" type="text"></input>

Both are correct strictly according to the standard, but older browsers may
have trouble when you close an element they don't know should be
closed.  Hence, most people just use the shorted syntax (that and it's less
typing).  :-)

~~Ian


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com




More information about the thelist mailing list