Register

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
    Posts
    6
    Member #
    4288
    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.

  2.  

  3. #2
    Junior Member jaynon's Avatar
    Join Date
    Nov 2004
    Posts
    16
    Member #
    8267
    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" "http://www.w3.org/TR/REC-html40/strict.dtd">


    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" "http://www.w3.org/TR/REC-html40/loose.dtd">


    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" "http://www.w3.org/TR/REC-html40/frameset.dtd">

    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 w3.org, and a quick search of that website produced a useful page: http://www.w3.org/QA/2002/04/valid-dtd-list.html

    After looking at one of your websites (http://www.trulybizarre.co.uk/) 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"
    "http://www.w3.org/TR/html4/loose.dtd">

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

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

  5. #4
    Junior Member Toneboy's Avatar
    Join Date
    Dec 2003
    Posts
    6
    Member #
    4288
    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 12:06 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com