SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Member
    Join Date
    Feb 2011
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Which "DOCTYPE" should I use

    Hi! I am at the start of "Build Your Own Web Site The Right Way Up...". The book did not mention 'Transitional' and 'Frameset' only the 'Strict'.
    I understand that this may be a way to make newbie stick to the straight and narrow road of web development but, I want to know where and when can one use the other options or is it better to forget them and concentrate on the strict?
    Also, why 'XHTML1.0 strict' and not 'XHTML4.01 strict' in the declaration given?
    Can anyone help and explain these things?
    Thanks.

  2. #2
    Mouse catcher silver trophy
    Stevie D's Avatar
    Join Date
    Mar 2006
    Location
    Yorkshire, UK
    Posts
    5,837
    Mentioned
    114 Post(s)
    Tagged
    1 Thread(s)
    The best advice is to forget Transitional and Frameset completely, and just work on Strict. The only extra features you can use in Transitional or Frameset are ones that you shouldn't be using – they have been deprecated (ie, you're not supposed to use them) for over 10 years now. All of those effects can more legitimately be achieved by other HTML elements and by CSS.

    As to whether to use HTML or XHTML – my vote would be for HTML but this is already being discussed at great length, and the greatest minds on Sitepoint Forums can't agree...

  3. #3
    SitePoint Member
    Join Date
    Feb 2011
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Stevie D View Post
    The best advice is to forget Transitional and Frameset completely, and just work on Strict. The only extra features you can use in Transitional or Frameset are ones that you shouldn't be using – they have been deprecated (ie, you're not supposed to use them) for over 10 years now. All of those effects can more legitimately be achieved by other HTML elements and by CSS.

    As to whether to use HTML or XHTML – my vote would be for HTML but this is already being discussed at great length, and the greatest minds on Sitepoint Forums can't agree...
    Thanks for your help. I can continue my reading now.

  4. #4
    SitePoint Wizard donboe's Avatar
    Join Date
    Jun 2010
    Location
    Netherlands
    Posts
    1,967
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by webgypsy View Post
    unless for some reason you "must" use deprecated code in which case you would use Transitional or Frameset.
    I can't figure what reason that would be? Strict is the way to go like Stevie mentioned. There is no reason or excuse or what so ever to use Transitional or Frameset.
    “Good artists copy, great artists steal” (Pablo Picasso - 1934)

  5. #5
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,608
    Mentioned
    24 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by webgypsy View Post
    where someone is asked to work on old legacy code with frames or whatever in it and it's not economical or practical to rehash the code entirely to Strict.
    Well that's why the transitional and frameset doctypes exist - for pages that were originally written way back before HTML 4 that you haven't had time to finish rewriting to use HTML 4 properly yet.
    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="^$">

  6. #6
    SitePoint Mentor bronze trophy
    John_Betong's Avatar
    Join Date
    Aug 2005
    Location
    City of Angels
    Posts
    1,580
    Mentioned
    63 Post(s)
    Tagged
    3 Thread(s)
    I like to use strict because it is so easy to check the validity of a web-page. Results are instant along with verbose error details and suggestions.

    http://validator.w3.org/check?uri=ht...Inline&group=0

  7. #7
    Mouse catcher silver trophy
    Stevie D's Avatar
    Join Date
    Mar 2006
    Location
    Yorkshire, UK
    Posts
    5,837
    Mentioned
    114 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by webgypsy View Post
    If/when HTML5 ever becomes an official recommended standard, I will most likely use HTML5 from then on because development for xhtml has ceased afaik.
    XHTML 5 will be released in parallel with HTML 5 for anyone who has a fetish for closing spot tags. TPTB seem to have finally realised, after the fiasco of XHTML 2, that new versions of XHTML will only be successful if they are an XML-compatible version of the current HTML language, and any forking in the language will be the death of them.

  8. #8
    SitePoint Enthusiast
    Join Date
    Jul 2010
    Posts
    93
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I use <!DOCTYPE html>

    But before people start yelling at me... use whichever you want. It doesn't really affect anything except the validator

    Strict is a good place to start because it promotes good practice, but if you simply can't get the damn thing to work properly without it being Transitional (sometimes we simply don't have control over all of the HTML output), that's fine as well


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
  •