Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > HTML 4.01 Validation Problem...

HTML 4.01 Validation Problem...
Thread Tools
Grizzled Veteran
Join Date: Jun 2002
Status: Offline
Reply With Quote
Apr 14, 2004, 10:48 AM
 
Hey guys,

I'm trying to make this page HTML 4.01 Transitional. But I am getting 3 errors I simply do not get:

For example, the first error is:

Line 7, column 71: document type does not allow element "META" here:

1: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2: <html>
3:
4: <head>
5: <title>Talacia Software</title>
6: <link rel="stylesheet" href="stylesheet.css" type="text/css" />
7: <meta http-equiv="content-type" content="text/html;charset=ISO-8859-1" />
8: </head>

I can't see anything wrong with the above? As for the next 2 errors:

Line 8, column 6: end tag for element "HEAD" which is not open (explain...).
</head>
^

Line 10, column 5: document type does not allow element "BODY" here (explain...).
<body>
^

If anyone can help, the source is available at http://www.talacia.com/new/index.php.
Thanks,
Oliver
     
Grizzled Veteran
Join Date: Oct 2003
Status: Offline
Reply With Quote
Apr 14, 2004, 11:08 AM
 
you are setting the doctype to HTML 4.01 but then mixing in XHTML tags.

if you change the doctype to:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
then your header validates ok, but then you have some more problems that need fixed with open <p> tags that are not closed, some tags not written as xhtml tags (ie you have some single tags written like <tag attributes /> but then others like <tag attributes>

the other solution if you wish to be validated is to not use XHTML tags and just use HTML
     
Clinically Insane
Join Date: Nov 1999
Status: Offline
Reply With Quote
Apr 14, 2004, 11:30 AM
 
Code:
6: <link rel="stylesheet" href="stylesheet.css" type="text/css" /> 7: <meta http-equiv="content-type" content="text/html;charset=ISO-8859-1" />
These two lines are the problem. If you're doing HTML (and not XHTML), then don't put the slash at the end of single tags. Technically it is compatible with pretty much every Web browser out there. But not only does it not validate, it breaks on such a low level that it tends to play havoc with validators.

The reason you don't understand those error messages is that they're not real errors at all! The actual error occurs in this line, but it breaks in such a way that it still looks good to the parser, and so it trips up later.
(Last edited by Millennium; Apr 14, 2004 at 11:36 AM. )
You are in Soviet Russia. It is dark. Grue is likely to be eaten by YOU!
     
Grizzled Veteran
Join Date: Jun 2002
Status: Offline
Reply With Quote
Apr 14, 2004, 01:36 PM
 
Thanks guys, I went through all my code and got rid of the /> and replaced them with >, validates fine now.

Again Thanks,
Oliver
     
Mac Elite
Join Date: Oct 2000
Status: Offline
Reply With Quote
Apr 14, 2004, 03:01 PM
 
Originally posted by iOliverC:
Thanks guys, I went through all my code and got rid of the /> and replaced them with >, validates fine now.

Again Thanks,
Oliver
I'd suggesting putting back all the "/" (otherwise known as escaping your tag) and then validate as XHTML Using HTML 4.01 will put the browser into quirks mode and may not render everything properly... that and generally if you're using a CSS layout you use XHTML.
     
Grizzled Veteran
Join Date: Jun 2002
Status: Offline
Reply With Quote
Apr 14, 2004, 03:02 PM
 
I was planning to use XHTML (thus the /> tags), but then I had to use a table, and XHTML no likie tables .
     
Mac Elite
Join Date: Oct 2000
Status: Offline
Reply With Quote
Apr 14, 2004, 11:59 PM
 
Originally posted by iOliverC:
I was planning to use XHTML (thus the /> tags), but then I had to use a table, and XHTML no likie tables .
Although using tables for layout isn't technically semantic, XHTML has no problems with tables... tables are still useful for tabular data. XHTML doesn't make any distinction between layout tables or data tables though. My point being that you should be able to use an XHTML doctype just fine. And BTW, if you're referring to the particular page you posted, you don't need tables for any of that But since you've already done the whole design, it may not be worth it to redo everything.
     
Clinically Insane
Join Date: Nov 1999
Status: Offline
Reply With Quote
Apr 15, 2004, 05:00 AM
 
Originally posted by iOliverC:
I was planning to use XHTML (thus the /> tags), but then I had to use a table, and XHTML no likie tables .
XHTML still does tables, even in Strict mode. Abusing tables for layout is still a Bad Thing, but even tables have their time and place (namely, actual tabular data), and so they were never taken out of HTML.
You are in Soviet Russia. It is dark. Grue is likely to be eaten by YOU!
     
Grizzled Veteran
Join Date: Jun 2002
Status: Offline
Reply With Quote
Apr 15, 2004, 09:20 AM
 
Hmm, I guess I'm just lazy .

But I remember when I tried to validate the same page using XHTML, that it gave an error mentioning something about cellpadding. I assumed it didn't let me use tables, also I remember someone telling me the same thing, guess he was wrong.

I need to learn how to use div's positioning, that's where I can get confused.

Thanks,
Oliver
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 09:08 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2