Free Republic
Browse · Search
General/Chat
Topics · Post Article

To: sig226
Now it's even more interesting. I've been closing the img tag for years and the internet hasn't blown up. I must have been doing it wrong.

Well, you have not been following the HTML specification. I have been using HTML since 1995, and I have never used a closing tag for the img tag because it is an empty tag. There has never been a closing tag in the HTML specification for the img tag. That is true of some other tags as well such as the break <br> tag and the <meta> tag.

So what does a web browser like Internet Explorer do when you put in an ending tag that is not part of the HTML specification? Most likely, it will ignore it because that tag is not providing any useful information.

There are other tags like the paragraph tag <p> that require a closing tag </p>, but many authors leave it out. So what does the browser do? It infers from the next opening <p> tag that the previous paragraph should be closed.

My point is this: the HTML sandbox is for newbies. Why complicate things for them by showing a closing img tag that is not part of the HTML specification and certainly not required?

If you want to do extra work by writing an unnecessary closing tag, I think you should continue doing so. But I don't think you should burden a newbie with that.

133 posted on 12/28/2008 7:54:26 PM PST by stripes1776 ("That if gold rust, what shall iron do?" --Chaucer)
[ Post Reply | Private Reply | To 132 | View Replies ]


To: stripes1776


134 posted on 12/28/2008 8:16:32 PM PST by az.b1bbomberfxr
[ Post Reply | Private Reply | To 133 | View Replies ]

Free Republic
Browse · Search
General/Chat
Topics · Post Article


FreeRepublic, LLC, PO BOX 9771, FRESNO, CA 93794
FreeRepublic.com is powered by software copyright 2000-2008 John Robinson