Forum Moderators: open

Message Too Old, No Replies

What Doctype to choose?

         

fashezee

5:53 pm on Mar 25, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I have been slacking with regards the the DTD of a document. With strick, transitional, etc... how does one know what to choose anymore? I know HTML 4.01 is being phased out but where do we go from here?

encyclo

6:22 pm on Mar 25, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



HTML 4.01 is still the best choice in most circumstances, and it is far from being "phased out" for the moment.

We've had a few recent threads which might help guide you:

  • Which Doctype Should I Choose? [webmasterworld.com]
  • Quirks Mode vs. Standards Mode - overview [webmasterworld.com]
  • About the <!DOCTYPE> [webmasterworld.com]

    The best choice depends on whether you are converting existing pages or building new ones. HTML 4.01 Transitional is good first start:

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

    Using a "strict" version will push you towards removing deprecated presentational elements from the markup and use CSS instead, so is generally considered the "best" for new documents:

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
  • DrDoc

    8:38 pm on Mar 25, 2006 (gmt 0)

    WebmasterWorld Senior Member 10+ Year Member



    There is also no reason to choose XHTML right now, as XHTML is not properly supported by Internet Explorer.

    bezaleel

    10:41 am on Mar 31, 2006 (gmt 0)

    10+ Year Member



    I suggest you incorporate web standards in your designs or stand to be non-compliant in a few years.

    I recommend:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    or
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

    They give you a place in tomorrow's web design world. Also, I feel you should focus on cross-browser compliance in your designs. Internet Explorer is only one of the many browsers in the field.

    Wlauzon

    4:42 am on Apr 1, 2006 (gmt 0)

    WebmasterWorld Senior Member 10+ Year Member



    We have changed/are changing all to XHTML transitional. Partly because the new replacement for Frontpage matches that (supposedly), but also because over the years we have ended up with a wild variety of DOCTYPE on our various pages (some with none) and figured it was time to get them all up to date - or at least consistent.

    DrDoc

    7:11 pm on Apr 1, 2006 (gmt 0)

    WebmasterWorld Senior Member 10+ Year Member



    If you decide to go with XHTML, then you should probably also include the XML prolog, and serve the page with the application/xhtml+xml content-type header ... If not, it may cause problems and force browsers to use error handling guesswork when rendering your page.

    But, again, like I said ... XHTML is not properly supported by IE. It works in all other browsers though.

    [edited by: DrDoc at 7:28 pm (utc) on April 1, 2006]

    DrDoc

    7:27 pm on Apr 1, 2006 (gmt 0)

    WebmasterWorld Senior Member 10+ Year Member



    About XML prolog:
    An XML declaration is not required in all XML documents; however XHTML document authors are strongly encouraged to use XML declarations in all their documents. Such a declaration is required when the character encoding of the document is other than the default UTF-8 or UTF-16 and no encoding was determined by a higher-level protocol.

    About content-type ... You may only serve it as text/html if you follow all of these guidelines [w3.org]. More about the XHTML media types can be found here [w3.org]. Important reading, indeed.

    Make sure you have read and understand the XHTML documentation [w3.org] before switching over to XHTML, as there are quite a few important differences between XHTML and HTML.

    This is especially important with regards to document wellformedness and PCDATA content (such as embedded scripts and stylesheets).

    <script type="text/javascript">
    <![CDATA[
    ... unescaped script content ...
    ]]>
    </script>

    The only browsers that have XHTML1 support are Mozilla Gecko based, Opera, MSN for OSX, Safari/WebKit, OmniWeb/WebCore, and Konqueror/KHTML. Those support XHTML1 served as XHTML. Internet Explorer has no support for documents served as XHTML on any platform, has no support for the XHTML1 namespace in XML, and has in fact no XHTML1 support at all. It has the HTML tag soup support that Appendix C was targetting only.

    tedster

    2:48 pm on Apr 2, 2006 (gmt 0)

    WebmasterWorld Senior Member 10+ Year Member



    Continued here: [webmasterworld.com...]