DTD: XHTML and CSS

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • wavedancer
    New Member
    • Jan 2007
    • 16

    DTD: XHTML and CSS

    I've just taken over a website that somebody else built and I'm trying to tidy it up and sort out a few problems. I've not built a site for a while – and certainly nothing as complicated as this one – and things have moved on a bit, so I am trying to absorb CSS for layout, whereas in the past I used tables.

    My first question concerns the DOCTYPE. Reading drhowarddrfine' s post about this, I see that the site I've inherited uses a different declaration:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
    <html xml:lang="en">
    <head> ...

    Should I be using the 'strict' version

    <?xml version="1.0" encoding="utf-8"?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>...

    recommended by W3C, or will the declarations that came with the website be OK? I've found a few strange activities in IE/Win which I'm slowly sorting out, but I'm wondering to what extent the DTD is responsible.

    Thank you.
  • drhowarddrfine
    Recognized Expert Expert
    • Sep 2006
    • 7434

    #2
    Xhtml version 1.1 is a modular version of xhtml and should never be served as text/html. You are probably doing this so using 1.1 is wrong. Drop back to 1.0.

    As stated in the sticky, IE does not know anything about xhtml served as xhtml. So using the xml declaration at the head will only throw it into quirks mode.

    Unless you are serving your pages as text/xhtml+xml, the xml declaration does you know good anyway so just remove it. Other than that, your second doctype is the one you should use.

    Comment

    • wavedancer
      New Member
      • Jan 2007
      • 16

      #3
      Originally posted by drhowarddrfine
      Other than that, your second doctype is the one you should use.
      Thank you very much. Now to see what goodies that throws up...

      Helen

      Comment

      Working...