Forum Moderators: open
"end tag for element "HEAD" which is not open"
There are also a lot of these:
"end tag for element "INPUT" which is not open"
Please explain to me what that means. Why should it be open?
Also, is it possible for a document to validate and still not display correctly in certain browsers?
"end tag for element "HEAD" which is not open"
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Untitled</title>
</head>
Or something in between the opening head tag and the closing head tag that it did find is causing it to trip up, thinking there is no opening head tag.
"end tag for element "INPUT" which is not open"
Believe it or not, I have seen input tags coded like this:
<input type="text"> </input>
There is no closing tag for an input, it stands on its own. Why people put them in is a mystery to me.
Also, is it possible for a document to validate and still not display correctly in certain browsers?
Absolutely. Proprietary code (that which is only for a certain browser) and browsers that do not support whatever attribute you are using can cause all sorts of havok. Dig around the CSS forum, it's my guess 90% of the cries for help are because something works in one browser and not another.
1) For the <head> I left out <title> which is a required element in HTML.
2) For the <input>s I'm using XHTML and have forgotten the self closing slash: <input />
Also, is it possible for a document to validate and still not display correctly in certain browsers?
Absolutely. Validation theoretically means that everything will work perfectly, but assumes two things. First, that the validator doesn't have any bugs (it does, although thankfully mostly edge cases). Secondly, that browsers don't have any bugs. Errr.
[edited by: Robin_reala at 7:14 am (utc) on Sep. 22, 2006]
"end tag for element "HEAD" which is not open"
It is quite possible you are using ' />' to close your meta tags (link tags etc.) as required by XHTML, but you are using an HTML4.01 Transitional DOCTYPE (a strict DOCTYPE does not seem to give this particular error).
"end tag for element "INPUT" which is not open"
(Same idea but...) Are you using inline JavaScript to write out parts of your page? In which case you need to escape the '/' (forward slash) in any closing tags. ie:
<script>
var myvar1 = '<a href="#">This is a link</a>'; // Error!
var myvar2 = '<a href="#">This is a link<\/a>'; // Escaped - OK
</script>
The first line will give the error "end tag for element "A" which is not open." The second line is OK. My guess is that you are writing your <input> tag in a similar way - but you don't need the closing '/>' tag anyway because you are using an HTML DOCTYPE.
This is essentially the opposite way round to Robin's #2 (above) which would produce the error "end tag for "input" omitted, but OMITTAG NO was specified"