SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Addict jlisec01's Avatar
    Join Date
    Nov 2006
    Location
    MI
    Posts
    331
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    choosing a doctype?

    hi there, i was just wondering the difference between the doctypes, obviously I'd never use a frameset, but you have strict and transitional for xhtml or html and then you have a declaration for xhtml 1.1, but what situations I guess you can say would you use each of these doctypes? thanks for any help i appreciate it.

  2. #2
    SitePoint Zealot
    Join Date
    Mar 2008
    Posts
    116
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I recommend carefully reading Henri Sivonen's great page on this subject: Activating Browser Modes with Doctype

    James

  3. #3
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,869
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    99.99% of the time new web pages should use the following doctype.

    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
    "http://www.w3.org/TR/html4/strict.dtd">
    The other 0.01% of the time you'd use

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    Unless you know for certain that your page requires the second of these you should use the first.

    The transitional doctypes are for old web pages that you haven't had time to fix properly yet. You'd only use them thr new pages added to a site using a template where the template hasn't been fixed yet.

    You can't use XHTML 1.1 for web pages at all since Internet Explorer doesn't understand XHTML and XHTML 1.0 is the only XHTML version that can be served as HTML.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">


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
  •