Page 1 of 3 123 LastLast
Results 1 to 10 of 25

Thread: What good is a DOC TYPE?

  1. #1
    Join Date
    Aug 2005
    Posts
    200
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default What good is a DOC TYPE?

    What good is a DOC TYPE? It works even if it doesn't have one of these and there isn't really much of a difference for the purpose for them, as far as I have found. Is there a place that talks about the need for a doc type in html? Thanks for the help, JF

  2. #2
    Join Date
    Jan 2006
    Location
    Ft. Smith, AR
    Posts
    795
    Thanks
    57
    Thanked 129 Times in 116 Posts

    Talking One of the most common...

    This is one of the most commonly used DOC Types...

    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    And here is a link to a page talking about DOC Types...

    WDG DOC Type Validator
    --------------------------------------------------
    Reviews, Interviews, Tutorials, and STUFF
    --------------------------------------------------
    Home of the SexyBookmarks WordPress plugin

  3. #3
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    A DOCTYPE defines the version of HTML that's being used in the document. As such, it is vital in a correctly-formed HTML document. Most browsers will attempt to ignore that and carry on (rendering in Quirks mode), but this is nefariously unreliable (since it deliberately emulates bugs) and inconsistent amongst browsers. Besides, do you really want your page to have to be error-corrected by the browser before being parsed?
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  4. #4
    Join Date
    Dec 2004
    Location
    UK
    Posts
    2,358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by Freeman
    What good is a DOC TYPE?
    Read Activating the Right Layout Mode Using the Doctype Declaration, by Henri Sivonen.


    Quote Originally Posted by Nyne Lyvez View Post
    This is one of the most commonly used DOC Types...

    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    Perhaps, though from a practical point of view, it might as well not be there at all. Not because document type declarations should be omitted - they shouldn't - but because a Transitional document type, without the system identifier (the URI), will cause many modern browsers to go into "Quirks" mode.

    Either use a Strict document type, or include the system identifier. Preferably do both for any new documents. Also, HTML 4.01 is the current version of HTML; 4.0 was superseded a long time ago.

    Mike

  5. #5
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,494
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    Should a website use the same DOC type throughout or is it acceptable for different pages to have different DOC's?
    {CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
    Follow Me on Twitter: @InkingHubris
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

  6. #6
    Join Date
    Sep 2005
    Location
    India
    Posts
    1,627
    Thanks
    6
    Thanked 107 Times in 107 Posts

    Default

    A good article covering this point

  7. #7
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,494
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    Thanks. It explains the different DOC types well, but still doesn't say if it is okay to switch types within a site or not..
    {CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
    Follow Me on Twitter: @InkingHubris
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

  8. #8
    Join Date
    Sep 2005
    Location
    India
    Posts
    1,627
    Thanks
    6
    Thanked 107 Times in 107 Posts

    Default

    I think the main difference of the DOC types comes whenever you validate the page.

    The validation is based on the DOC type of your page.

    I don't think if we don't consider validation of (X)HTML then there won't be any practical problems with using different DOC types in different pages.

  9. #9
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,494
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    Thanks for the advice!

    I try to stay with trans 4.01 but you never know... if I use some XHTML it wont validate... not that many of my pages do at this point, but I am working on redoing them all right now and might as well try, LOL
    {CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
    Follow Me on Twitter: @InkingHubris
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

  10. #10
    Join Date
    Sep 2005
    Location
    India
    Posts
    1,627
    Thanks
    6
    Thanked 107 Times in 107 Posts

    Default

    To maintain consistent DOC Types in a site is the best strategy i think. So that can avoid any sort of confusing problem especially while validating a site, etc...

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •