Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

W3C//DTD HTML 4.0 1

Status
Not open for further replies.

wolf73

Programmer
Feb 12, 2006
93
CA
Hi,

In lot of webpages you will see that statment at the top.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

Whats does that mean? If you don't have this at top, what difference will it make ......... thanks
 
This is called a DOCTYPE
It means that the author has (supposedly) built the site to conform to W3C standards. In this case, specifically standards for HTML 4.0 Transitional.

This allows the browser to know how it should interpret the code that has been written.

Since the coder is using a standard it's easier to ensure that the code is rendered in the same way across different devices.

When using DOCTYPES you should ensure that your page validates to the DOCTYPE by using a validator like the one available at the W3C site.

<honk>*:O)</honk>
Foamcow Heavy Industries - Web site design in Cheltenham and Gloucester
Ham and Jam - British & Commonwealth forces mod for Half Life 2
 
I have this website.


Now if I do not have any DOctype page gets displayed fine
If I have

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Transitional//EN">

But if I have
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

The left side menue go at the bottom of the page. Does that mean that IE is thinking that I have used HTML 4.0 but in HTML 4.0 menues are not made the way I have built it here?
 
It means your site is not coded to standards but actually to cater to IE's quirks. By providing a doctype IE jumps out of the quirks into as-close-to-standards-as-we-can-get mode and your page breaks. Read the article given to you, put a doctype on your page (first thing) and start redesigning. If you think that is a stupid thing to do, be aware that your page was probably looking broken in every other browser but IE already.
 
No I mean if I have

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Transitional//EN">

It is fine , but if I have

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

Menue get dislocated. Does that mean I am meeting the W3C standrard for 3.2 but not for 4.0


 
Suggest you have a look at your page in a browser that is closer to being standards-compliant (Mozilla, Firefox, Opera etc), then you will see how broken your site really is!

When you recognise the extent of the problems for yourself, then go back to the advice given above, and start redesigning. There are several sites to check your page for compliance, including:

Check your site on them to get a feel for where you are.

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?'
Drive a Steam Roller
 
Check this page:
It will show you how different doctypes you use affect your rendering differently. If it says Q (quirks mode), then doctype is not in effect -- and browser treats it as if there's no doctype specified. If it is S (standards mode) then browser adheres to standards and users the standards rendering engine. With your first doctype it clearly works in quirks mode and with the second one in standards mode. Note that the difference in both engines is huge only for IE. Both quirks mode and standards mode are very similar (and work like standards mode) in other browsers, so your content is broken everywhere but IE.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top