Forum Moderators: open
I had the following doctype on my page:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
And all was good until someone pointed out that it was incomplete as it was missing the url. So i added this doctype:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
But now my site is all messed up. Titles and words have moved to different locations, forms have different border thickness and things just look different.
Why is this? I just deleted the url so my page has gone back to normal. Is it such a big deal if i dfont have a doctype? My site looks fine in all major browsers as is and i cant use the wc3 validator anyway because all my pages are php and covered with scripts.
Any info would be great.
Thanks
It doesn't matter if you use script for your page, it will still validate if you do it correctly. If it's not validating then you are doing something wrong.
The problem with this is in quirksmode not all browsers have the same quirks - that's the point of standards mode.
You should always use a full doctype (with the URL) if you are building pages with CSS positioning instead of tables as the standards-compliant parsing mode makes it much easier to ensure cross-browser consistency.
Its been a while but have now decided to bite the bullet and use the full doctype and fix up the errors.
I have a couple of questions about it. First, is this doctype here the proper current one to use?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
Also, I am developing my site on my home computer that is sometimes not connected to the internet. If i'm not connected to the net, how can the browser contact that dtd at the specified url? Does is switch back to quirks mode when offline?
Also, is there a place that lists what code u can and cant use in html 4.1 using the above dtd?
Thanks :)
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
As for reference on what can and can't be used, the original W3C docs are a good place to start for both HTML [w3.org] and CSS [w3.org].