Welcome to WebmasterWorld Guest from 54.198.229.157

Forum Moderators: incrediBILL

Message Too Old, No Replies

DOCTYPE and W3C problems

looks like crap!

     
8:38 pm on Apr 13, 2004 (gmt 0)

Junior Member

10+ Year Member

joined:July 28, 2003
posts:65
votes: 0


Ok, I am trying to make my site w3c valid however, it is requiring me to put this doctype line in my header:


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Strict//EN">

When I do this, it seems to have no visual effect in IE6, however when viewed in mozilla based browsers, (i tested in firefox), it completely looked like crap, its almost like it was defaulting the cellspacing to 5 or 6 pixels. I also tried different HTML versions with no luck.

I will post the urls to the page with it and the page with out it so you can see what I'm talking about, but I need to know if thats allowed here before I do...

Anyone know what i need to do?

Thanks,
Rick

8:51 pm on Apr 13, 2004 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Nov 13, 2002
posts:818
votes: 0


Your DOCTYPE just needs a little tweaking. Get rid of the "Strict", and add the full path:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
3:57 pm on Apr 14, 2004 (gmt 0)

Full Member

10+ Year Member

joined:Mar 15, 2002
posts:346
votes: 0


Using "Strict" is exactly that. I recently made one of our site W3C valid, but felt that the strict version was just a litte to strict for what we needed.

We used the transitional tag, which looked like this:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

We never had any problems with it, and the page is valid.

Hope this is of some help.
Webboy

7:26 pm on Apr 14, 2004 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Mar 8, 2003
posts:1429
votes: 0


Likewise the correct doctype for transitional is actually..

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

Using the "short" version puts IE6 (and some other browsers) into quirks-mode where they simulate old browser bugs (like the broken box model from IE5.*)

Always use a FULL doctype to ensure your document is rendered in 'standards compliant' mode.

See:
w3c list of valid doctypes [w3.org]
Microsoft on the doctype switch in IE6 [msdn.microsoft.com]

10:07 pm on Apr 21, 2004 (gmt 0)

New User

10+ Year Member

joined:Apr 21, 2004
posts:3
votes: 0


My doctype :

<?xml version="1.0" encoding="windows-1250"?>
<!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">

the page is perfectly runs with IE ,but with Netscape its fall apart, what cause this problem?

10:10 pm on Apr 21, 2004 (gmt 0)

Moderator

WebmasterWorld Administrator ergophobe is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Apr 25, 2002
posts:8298
votes: 142


Wipmaster,

What falls apart?

The <?xml> declaration is probably not advisable. It is not required by the recommendations and it forces IE into quirks mode. If you design in IE using CSS and then look in another browser, things may indeed go all crazy.

BTW, I assume you mean Netscape 7.x and not 4.x. If the latter, then IE is running in quirks and NS is running is extreme quirks mode.

10:16 pm on Apr 21, 2004 (gmt 0)

New User

10+ Year Member

joined:Apr 21, 2004
posts:3
votes: 0


i del the :

<?xml version="1.0" encoding="windows-1250"?>

line
but nothing happens :\

netscape ver terrible :(((

1:58 pm on Apr 22, 2004 (gmt 0)

Moderator

WebmasterWorld Administrator ergophobe is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Apr 25, 2002
posts:8298
votes: 142



its almost like it was defaulting the cellspacing to 5 or 6 pixels. I also tried different HTML versions with no luck.

Keep in mind, there is no standard for spacing (padding and margins). Each user agent is free to interpret as it wishes. Have you tried specifically setting border, margins, padding with CSS for all elements involved?

One thing that can help sort things out is to apply background colors so you can see who's really upsetting things.

Tom

12:33 am on Apr 23, 2004 (gmt 0)

New User

10+ Year Member

joined:Apr 21, 2004
posts:7
votes: 0


Advise:

When you creating a website, it can be a good thing to check itīs performance in both IE, NN and Opera allready from the very beginng. When a problem appears, you can fix it immidiately and understand whatīs going on, instead of building up a huge amount of small problems you canīt survey.

Regards
Blackhole

12:47 am on May 12, 2004 (gmt 0)

New User

10+ Year Member

joined:May 2, 2004
posts:10
votes: 0


black hole, that's exactly what i do (nn, opera, ie) usually just ie and nn while coding and then testopera for a final checking later on.