tags:

views:

14

answers:

2

Hi, I'm having a problem regarding html.I got a html script contains no </body> nor </html> closing tags in the file yet when its source code view in the browser,both the </body> and </html> closing tags appears in the source code together with a <div>...</div> block of code. How could this possible to happen?

A: 

Sometimes, if you are using web authoring applications like dreamweaver, netbeans, .... etc, they complete your un-complete tags before publishing them.

And, nowadays browsers are smart enough to correct those mistakes, while rendering the HTML file.

May be you will not get the same result in old browsers like IE6, FF1........ Try it...

Starx
A: 

Those tags are defined as being optional in the specification. Their presence can be implied via the rules of HTML, so the tags themselves don't actually need to be present.

They should not show up when you view the source though.

Are you perhaps using something that shows a serialization of the DOM instead? e.g. the DOM Inspector in Firebug? The div sounds suspiciously like an element I remember older versions of Firebug adding.

David Dorward