Re: [www-validator] <none>

Dave Lumley wrote:
> Line 1, column 0: character "ï" not allowed in prolog
> ü/strong>?»¿<html><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 
> Transitional//EN">

When I validate it, I don't get that error message.  However, I do get 
dozens of others.

> I look in my file and there is nothing preceding my first line and 
> <html> tag

That is the first problem.  The DOCTYPE *should* be the first thing in 
the  file, only preceded by whitespace or a byte order mark (BOM). 
(technically, other things may precede it too, but nothing you need to 
worry about, since to do so will send some browsers into quirks mode) 
The <html> start-tag must follow the DOCTYPE.

If you wish to continue to use a Transitional DOCTYPE (though I 
recommend you use Strict and stop using deprecated features), then make 
this the first part of the file:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
<html lang="en">

Including the URI in the DOCTYPE ensures that browsers will try to 
render the document in standards mode (or almost standards mode), rather 
than the buggy, quirks mode designed to be backwards compatible with the 
broken behaviour of Netscape and IE 4.x.  Doing this may result in 
rendering changes in your page because it currently triggers quirks 
mode, but it's for the better because the browsers are more closely 
following the standards.

> the uri is

It seems the very first character in the file is a UTF-8 BOM.  These 
three symbols:  (which are actually the 3-octet UTF-8 BOM) appear 
when viewing the site because the character encoding has been 
incorrectly declared as ISO-8859-1.

These problems are discussed in more detail in my 3 part guide to unicode.

Lachlan Hunt     Rediscover the Web Reclaim your Inbox

Received on Friday, 15 April 2005 01:56:51 UTC