SitePoint Sponsor

User Tag List

Results 1 to 6 of 6

Thread: Doc Type??

  1. #1
    SitePoint Zealot
    Join Date
    Mar 2008
    Posts
    151
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Doc Type??

    Hey all,

    Can someone explain to me what doc type is?? i've read abit about them but don't fully understand, what actually is the difference between loose, transitional, and strict??? and what is the standard one to use when coding a website?? or does it depend on the website your coding?? any help would be great...

  2. #2
    SitePoint Wizard bronze trophy DaveWoods's Avatar
    Join Date
    Dec 2004
    Location
    Derbyshire - UK
    Posts
    2,651
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The article on alistapart explains it really well

    http://www.alistapart.com/articles/doctype/

    Personally I always use html 4.01 strict

    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
    "http://www.w3.org/TR/html4/strict.dtd">
    Basically, it ensures that all the modern browsers behave as close to web standards as their engine allows.

  3. #3
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,159
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The HTML FAQ explains what a doctype declaration is and what it's for. If that doesn't answer your questions, feel free to ask for further info.
    Birnam wood is come to Dunsinane

  4. #4
    SitePoint Zealot
    Join Date
    Mar 2008
    Posts
    151
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Cheers guys that helped alot....

  5. #5
    [Biped] LJK's Avatar
    Join Date
    Jun 2004
    Location
    In My Jammies
    Posts
    761
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I like thinking of the DTD as -
    "letting the browser know what 'flavor'
    of [x]html is coming its way..."

    F-Fox 2.0 :: WIN :: el design :: US

  6. #6
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,159
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The browser doesn't care. It supports HTML and doesn't care what version. You can declare HTML 4.01 Strict and use <FONT> tags, and they will work because the browser supports FONT elements.

    The doctype declaration is only meant for validation, but browsers don't use validating parsers.

    Nowadays the doctype declaration is used by browsers to determine the CSS compatibility mode, but that's a later invention.
    Birnam wood is come to Dunsinane


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
  •