WEB !DOCTYPE Question

Discussion in 'OT Technology' started by nucklearknight, Dec 2, 2008.

  1. nucklearknight

    nucklearknight New Member

    Joined:
    Sep 21, 2008
    Messages:
    367
    Likes Received:
    0
    Location:
    San Francisco, California
    I'm just going over a HTML tutorial and have a question about the !DOCTYPE tag at the top of the page. The example on the site looks like this:

    Code:
    <!DOCTYPE html PUBLIC "-//W3C/DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    My question is about the second line of the code. There is a URL and when I use this code on my website, what URL do I use?
     
  2. kingtoad

    kingtoad OT Supporter

    Joined:
    Sep 2, 2003
    Messages:
    55,923
    Likes Received:
    11
    Location:
    Los Angeles
    If you're using the XHTML 1.0 strict doctype, then you'll need to include the xhtml1 1 strict specification. If you're using the HTML 4.0 doctype, you'll need to include the HTML 4.0 specification.
     
  3. nucklearknight

    nucklearknight New Member

    Joined:
    Sep 21, 2008
    Messages:
    367
    Likes Received:
    0
    Location:
    San Francisco, California
    What's that?
     
  4. kingtoad

    kingtoad OT Supporter

    Joined:
    Sep 2, 2003
    Messages:
    55,923
    Likes Received:
    11
    Location:
    Los Angeles
    The example you showed is using the XHTML 1.0 strict doctype, thus it must point to the doctype specification, which is the URL that's provided. The doctype is just there to tell the browser how to render your document.
     
  5. whup

    whup I wish you had children and.. so that I could step

    Joined:
    Feb 12, 2007
    Messages:
    1,603
    Likes Received:
    0
    FYI that can be fit on a single line, it's a single declaration.

    You can read more about it here: http://en.wikipedia.org/wiki/Doctype

    If you're wondering, the browsers aren't going to use that URL, they just use the doctype declaration as a signature/switch to dictate what rendering mode to use.
     
  6. Krakerjak

    Krakerjak Active Member

    Joined:
    Jul 7, 2003
    Messages:
    8,288
    Likes Received:
    0
    Location:
    Edmonton eh
    from this article: http://www.w3.org/blog/systeam/2008/02/08/w3c_s_excessive_dtd_traffic
     
  7. nucklearknight

    nucklearknight New Member

    Joined:
    Sep 21, 2008
    Messages:
    367
    Likes Received:
    0
    Location:
    San Francisco, California
    Ohh ok thank you all
     

Share This Page