If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 4 of 4

Thread: Doctypes

  1. #1
    Junior Member Toneboy's Avatar
    Join Date
    Dec 2003
    Member #
    Using the validation tools available with the Firefox Webdeveloper toolbar (fantastic resource, btw) I've seen that my pages currently don't have a DOCTYPE specified at the top of my pages.

    Given that I'm producing dynamic PHP/MySql pages what doctype setting should I be using? What variations can you have, and are there any cross-browser issues that I should be aware of?

    Thanks in advance.


  3. #2
    Junior Member jaynon's Avatar
    Join Date
    Nov 2004
    Member #
    Well it depends. If your scripts are spitting out HTML 4.0 for example, there are three DTD's specified for use with HTML 4.0, one of which must be included in the document. Each DTD varies in the elements it supports.

    HTML 4.0 Strict DTD
    All elements and attributes that have not been deprecated.

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

    HTML 4.0 Transitional DTD
    Includes everything in the strict DTD as well as deprecated elements and attributes. (Most of the deprecated elements and attributes cover visual presentation.)

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

    HTML 4.0 Frameset DTD
    Includes everything in the Transitional DTD as well as frames

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

    HTML 4.0 was just an example, if you're using say XHTML 1.0 your doctype would be slightly different. Your best resource is, and a quick search of that website produced a useful page:

    After looking at one of your websites ( I would say your code is most closely related to HTML 4.01 Transitional. So whack this doctype in:

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

    Once you've put that in, run it through the w3 validator located here:

  4. #3
    Senior Member Trico's Avatar
    Join Date
    Feb 2004
    Nottingham, UK
    Member #

  5. #4
    Junior Member Toneboy's Avatar
    Join Date
    Dec 2003
    Member #
    Excellent, thanks for the help.

    I have a few issues to correct with IE now, but if it helps tighten my code up so much the better.

    Thanks again.

Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
All times are GMT -6. The time now is 09:21 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2020 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: