SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Enthusiast TheNinthPlayer's Avatar
    Join Date
    Jan 2004
    Location
    USA
    Posts
    74
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Doctype formatting. Does it matter?

    Okay I've seen DOCTYPES written 3 diffrent ways.
    Code:
    <!DOCTYPE
     html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
     "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
        "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
    Does it matter how whitespace effects the DOCTYPE or do browsers not care?

  2. #2
    SitePoint Guru
    Join Date
    Mar 2004
    Location
    Earth
    Posts
    406
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It doesn't make a difference - do what's easiest for you.

  3. #3
    SitePoint Zealot
    Join Date
    Jul 2003
    Location
    Murfreesboro, TN
    Posts
    113
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    On a related note, I have read in the WC3 "intro to XHTML" that it is not necessary to add the "xmlns=http://www.w3.org/1999/xhtml" to the <html> tag, since it is a fixed value and will be inserted automatically anyway.

    If that's the case, why should I include it at all in my pages?

  4. #4
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,235
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by brothercake
    It doesn't make a difference - do what's easiest for you.
    The only difference is when you have any content before your DOCTYPE (i.e. comments, whitespace, an <?xml declaration?> ), which will throw IE/Windows into quirks mode.

  5. #5
    Robert Wellock silver trophybronze trophy xhtmlcoder's Avatar
    Join Date
    Apr 2002
    Location
    A Maze of Twisty Little Passages
    Posts
    6,316
    Mentioned
    60 Post(s)
    Tagged
    0 Thread(s)
    Why you should insert the XMLNS is to give a namespace reference for the XML document is so it can be kept within restraints and it is a way to distinguish between duplicate element type and attribute names.


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
  •