Forum Moderators: open
I also looked for a solution and came across this Webmaster forum thread, which details a bug regarding the DOCTYPE you must use:
When I copied the HTML 4 DOCTYPE said to be safe for NS 6.2 from there, my page then worked. I also upgraded a Javascript file as that was known to cause odd problems too.
I thought it was the Javascript at fault, so I went back to my standard DOCTYPE, which is the XHTML Transitional one. Now the user gets a blank screen. Other pages on the site are missing elements. They also crash the browser again.
So I switched back to the HTML 4 DOCTYPE and the user can now view my page correctly.
Is there a known bug with using an XHTML DOCTYPE in Netscape 6.2? I don't want to lose it, as it might affect positioning and layout in IE6. Also my code really is XHTML.
Naturally IE is by far the most used browser and therefore their most important consideration but consider this. Moz is compliant and unforgiving, if you code for it using what IE can handle there will be no errors in IE. IMO a much easier route.
gph: Does it work in Moz 1x?
tedster: I'm confused whether your HTML is actually XHTML or HTML 4.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
felix: If you already tried this, ignore, but the validator on w3.org should find any inconsistancies between your doctype declaration and the actual code.
"Sorry, I am unable to validate this document because its content type is application/octet-stream, which is not currently supported by this service."
What the....?
So I uploaded the file but suddenly styles aren't working! Agh! So I validated a similar page using my usual XHTML doctype and got this:
"I was not able to extract a character encoding labeling from any of the valid sources for such information. Without encoding information it is impossible to validate the document. The sources I tried are:
* The HTTP Content-Type field.
* The XML Declaration.
* The HTML "META" element.
Since none of these sources yielded any usable information, I will not be able to validate this document. Sorry. Please make sure you specify the character encoding in use."
OK, the first one leads me to this line in my code - is it incorrect?
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
Thirdly, I only have the standard META tags in place for things like author and description etc. I don't have one to define the character encoding.
Looks like I've slipped up somewhere. What should I do to retain XHTML and make it work in NS 6.2 and also the W3C Validator?
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>
Check on <a href="http://validator.w3.org/check/referer">w3.org valitator</a>.
</body>
</html>
...and then add it back bit by bit until it breaks?
The character encoding is specified in the xml declaration (encoding="UTF-8"). This quote is directly from the XHTML recommendation.
Here is an example of a minimal XHTML document.<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Virtual Library</title>
</head>
<body>
<p>Moved to <a href="http://vlib.org/">vlib.org</a>.</p>
</body>
</html>
Note that in this example, the XML declaration is included. An XML declaration like the one above is not required in all XML documents. XHTML document authors are strongly encouraged to use XML declarations in all their documents. Such a declaration is required when the character encoding of the document is other than the default UTF-8 or UTF-16.
Here is the URI to the section titled "Document Conformance".
http://www.w3.org/TR/2000/REC-xhtml1-20000126/#docconf
Hester, Let us know if toolman's suggestion works. That's a great tidbit about NN.
I will try the new doctype suggested by toolman, and see what happens.
I'm also reluctant to add the XML declaration as IE6 switches to Quirks Mode if that's there. Can anyone suggest a way to get the character encoding correct so the page will be validated?
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-type" content="text/html;charset=ISO-8859-1" />
<meta http-equiv="Content-language" content="en" />
You can even replace Strict with Transitional (both instances) and it will still work in NN6.2 (and validate)
2. Line 100, column 168: document type does not allow element "table" here; missing one of "object", "applet", "map", "iframe", "button", "ins", "del" start-tag...with address, emails and search form">
100: <p id="holdall"><br /><table id="main" width="760" cellpadding="0" cellspacing="10" border="0" summary="Table used for page layout with address, emails and search form">
7. Line 139, column 12: reference to non-existent ID "searchbutton"<label for="searchbutton"><input type="submit" value="Search" /></label>
8. Line 140, column 18: reference to non-existent ID "resetbutton"
<label for="resetbutton"><input type="reset" value=" Clear " /></label>
9. Line 137, column 12: reference to non-existent ID "q"
<label for="q"><b>Regional Contracts Search:</b> <input type="text" name="q"
It is, but you missed the point of what the error message said:
>> document type does not allow element "table" here; <<
That probably means that you simply have a nesting error, usually caused by trying to nest a block level element inside an inline element.
.
I need to think about your other question on IDs.
The start of my code is like this. What is wrong?
<div id="background"><img id="menubase" src="images/backgroundextra.gif" width="150" height="750" border="0" alt="" /></div>
<?php include("menu.html");?>
<div id="printernodiv">
<p id="holdall"><br /><table id="main" width="760" cellpadding="0" cellspacing="10" border="0" summary="Table used for page layout with address, emails and search form">