Quick HTML question

Discussion in 'HTML & Website Design' started by MCJim, Sep 7, 2008.

  1. #1
    What is the purpose of putting HTML code like this:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html dir="ltr" lang="en">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    Code (markup):
    at the top of a webpage? Why not just use <html>?
     
    MCJim, Sep 7, 2008 IP
  2. MCJim

    MCJim Peon

    Messages:
    163
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    ................
     
    MCJim, Sep 7, 2008 IP
  3. mikeythefish

    mikeythefish Peon

    Messages:
    57
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    doctyep basically tells a validator what type of html syntax your using so its while it being read
     
    mikeythefish, Sep 7, 2008 IP
  4. mshore

    mshore Peon

    Messages:
    416
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #4
    That particular header has a number of uses outside of just displaying a web page. DOCTYPE is used by a validator such as the one at W3C to ensure that your page is written to that standard. Without declaring the DOCTYPE a validator will be unable to give you automated feedback on the validity of your site. Additionally, encoding the page properly will tell most browsers how to render it for other regions in the world.
     
    mshore, Sep 7, 2008 IP