Recomendations for doctype
Results 1 to 14 of 14

Thread: Recomendations for doctype

  1. #1
    Member
    Join Date
    Jul 2013
    Posts
    43

    Recomendations for doctype

    What would you recommend for a doctype for my website? http://www.sourcevibe.com

  2. #2
    Senior Member traq's Avatar
    Join Date
    Jun 2011
    Location
    so.Cal
    Posts
    949
    Is there something wrong with the one it has?

  3. #3
    Pedantic Curmudgeon Weedpacket's Avatar
    Join Date
    Aug 2002
    Location
    General Systems Vehicle "Thrilled To Be Here"
    Posts
    21,771
    I can't recommend any doctype, since right now your document doesn't qualify for any of them. E.g. http://validator.w3.org/check?verbos...rcevibe.com%2F
    THERE IS AS YET INSUFFICIENT DATA FOR A MEANINGFUL ANSWER
    FAQs! FAQs! FAQs! Most forums have them!
    Search - Debugging 101 - Collected Solutions - General Guidelines - Getting help at all

  4. #4
    Settled 4 red convertible dalecosp's Avatar
    Join Date
    Jul 2002
    Location
    Accelerating Windows at 9.81 m/s....
    Posts
    7,621
    If you want to fix the errors that Weedpacket refers to, keep the one you have; otherwise I'd switch to the one that gave the least number of errors...
    /!!\ mysql_ is deprecated --- don't use it! Tell your hosting company you will switch if they don't upgrade! /!!!\ ereg() is deprecated --- don't use it!

    dalecosp "God doesn't play dice." --- Einstein "Perl is hardly a paragon of beautiful syntax." --- Weedpacket

    Getting Help at All --- Collected Solutions to Common Problems --- Debugging 101 --- Unanswered Posts --- OMBE: Office Machines, Business Equipment

  5. #5
    Pna lbh ernq guvf¿
    Join Date
    Jul 2004
    Location
    Kansas City area
    Posts
    19,349
    HTML entities in all caps, tables used not for tabular data but for design, inline styles strewn all over the place... I think the 1990s are calling and asking for their webmaster back!

  6. #6
    Settled 4 red convertible dalecosp's Avatar
    Join Date
    Jul 2002
    Location
    Accelerating Windows at 9.81 m/s....
    Posts
    7,621
    Quote Originally Posted by bradgrafelman View Post
    inline styles strewn all over the place...
    *sigh* ... I've a bit to do on that one, myself....
    /!!\ mysql_ is deprecated --- don't use it! Tell your hosting company you will switch if they don't upgrade! /!!!\ ereg() is deprecated --- don't use it!

    dalecosp "God doesn't play dice." --- Einstein "Perl is hardly a paragon of beautiful syntax." --- Weedpacket

    Getting Help at All --- Collected Solutions to Common Problems --- Debugging 101 --- Unanswered Posts --- OMBE: Office Machines, Business Equipment

  7. #7
    Senior Member
    Join Date
    May 2013
    Location
    NYS
    Posts
    128
    Quote Originally Posted by dalecosp View Post
    If you want to fix the errors that Weedpacket refers to, keep the one you have; otherwise I'd switch to the one that gave the least number of errors...
    I'd agree with that. I've come to like HTML 5's doctype - it's simple, works across the board it seems, and since I've started digging into HTML5 it's not that complex at all except for a few deprecations which are easy to work around. I've really come to appreciate W3's code analysis, too; using it more and more now.

    Twayne`

  8. #8
    Senior Member traq's Avatar
    Join Date
    Jun 2011
    Location
    so.Cal
    Posts
    949
    At the end of the day, a valid doctype triggers "Standards Mode" in browsers, and (almost always*) nothing else.
    From a practical standpoint, and in most situations, it is therefore not very important which one you choose. (That means that HTML5's doctype - being the shortest and therefore easiest to type - wins out).

    * There are situations where it does matter, but I will be surprised if anyone knows of anything more than "edge" cases.

  9. #9
    Senior Member
    Join Date
    Jul 2007
    Posts
    3,619
    Quote Originally Posted by traq View Post
    At the end of the day, a valid doctype triggers "Standards Mode" in browsers
    Which today means HTML 5, since HTML 5 supersedes previous html versions. Wether you provide a valid html doctype for 4.01 (including the dtd), or simply <!DOCTYPE html> makes no difference - it will still be considered an HTML 5 document - Assuming the browser supports HTML 5. Since HTML 5 is based on parsing rules instead of SGML dtds, it will always be processed in the same way and the dtd will be ignored.

    As far as the doctype declaration goes, there would be two exceptions to the above. The first is if the browser doesn't recognize <!DOCTYPE html> as a valid doctype declaration. Which in turn means the browser do not recognize HTML 5 even partially. And the second would be to provide an incorrect doctype declaration so that the document cannot be considered html.

    The choice then boils down to serving your html 5 document as an html or an xml serialization.

    If you serve it as xml, you do not need the doctype declaration at all since it will be ignored. But you may leave it there. The only thing used to decide that this is an xhtml 5 document is the mime type: application/xhtml+xml. You will need an xml declaration, which must be the very first thing in the document (BOM ok?): <?xml ...>. You will also need to provide a default namespace on your root element: <html xmlns="go look it up somewhere">. Thus it would look something like
    HTML Code:
    <?xml ...>
    <!DOCTYPE html>
    <html xmlns="go look it up">
    and be served as application/xhtml+xml. The doctype declaration may be left out, but if it is present, DOCTYPE must be in upper case letters.

    While the html serialization would be
    HTML Code:
    <!DOCTYPE html>
    <html>
    served as text/html. And the doctype is still there only for legacy reasons so that some browser doesn't jump into IE5 mode, which it may do if your doctype declaration is incorrect. But you would not intentionally do that, would you?

    As for some of the differences that I find may be of importance:
    - No use of document.write in xml documents
    - No use of noscript elements in xml documents
    - cAsInG matters in xml documents.
    - no namespaces in html

  10. #10
    Senior Member
    Join Date
    May 2013
    Location
    NYS
    Posts
    128
    Quote Originally Posted by johanafm View Post
    Which today means HTML 5, since HTML 5 supersedes previous html versions. Wether you provide a valid html doctype for 4.01 (including the dtd), or simply <!DOCTYPE html> makes no difference - it will still be considered an HTML 5 document - Assuming the browser supports HTML 5. Since HTML 5 is based on parsing rules instead of SGML dtds, it will always be processed in the same way and the dtd will be ignored.

    As far as the doctype declaration goes, there would be two exceptions to the above. The first is if the browser doesn't recognize <!DOCTYPE html> as a valid doctype declaration. Which in turn means the browser do not recognize HTML 5 even partially. And the second would be to provide an incorrect doctype declaration so that the document cannot be considered html.

    The choice then boils down to serving your html 5 document as an html or an xml serialization.

    If you serve it as xml, you do not need the doctype declaration at all since it will be ignored. But you may leave it there. The only thing used to decide that this is an xhtml 5 document is the mime type: application/xhtml+xml. You will need an xml declaration, which must be the very first thing in the document (BOM ok?): <?xml ...>. You will also need to provide a default namespace on your root element: <html xmlns="go look it up somewhere">. Thus it would look something like
    HTML Code:
    <?xml ...>
    <!DOCTYPE html>
    <html xmlns="go look it up">
    and be served as application/xhtml+xml. The doctype declaration may be left out, but if it is present, DOCTYPE must be in upper case letters.

    While the html serialization would be
    HTML Code:
    <!DOCTYPE html>
    <html>
    served as text/html. And the doctype is still there only for legacy reasons so that some browser doesn't jump into IE5 mode, which it may do if your doctype declaration is incorrect. But you would not intentionally do that, would you?

    As for some of the differences that I find may be of importance:
    - No use of document.write in xml documents
    - No use of noscript elements in xml documents
    - cAsInG matters in xml documents.
    - no namespaces in html

    Good post; thanks for the input.

    Rivet`

  11. #11
    Settled 4 red convertible dalecosp's Avatar
    Join Date
    Jul 2002
    Location
    Accelerating Windows at 9.81 m/s....
    Posts
    7,621
    Quote Originally Posted by traq View Post
    * There are situations where it does matter, but I will be surprised if anyone knows of anything more than "edge" cases.
    That might depend on whether you consider hundreds of thousands of SOHO (or cubicle-based?) drones who are still on WinXP with IE7/8 as an edge case, wouldn't it?
    /!!\ mysql_ is deprecated --- don't use it! Tell your hosting company you will switch if they don't upgrade! /!!!\ ereg() is deprecated --- don't use it!

    dalecosp "God doesn't play dice." --- Einstein "Perl is hardly a paragon of beautiful syntax." --- Weedpacket

    Getting Help at All --- Collected Solutions to Common Problems --- Debugging 101 --- Unanswered Posts --- OMBE: Office Machines, Business Equipment

  12. #12
    Senior Member traq's Avatar
    Join Date
    Jun 2011
    Location
    so.Cal
    Posts
    949
    Quote Originally Posted by dalecosp View Post
    That might depend on whether you consider hundreds of thousands of SOHO (or cubicle-based?) drones who are still on WinXP with IE7/8 as an edge case, wouldn't it?
    I haven't tested IE6, but everything I've read says the HTML5 doctype does trigger standards mode. I have tested in IE7, and it triggers standards mode as expected.

    If you're talking about the HTML5 elements (e.g., <header>, <nav>, <main>, etc.) being broken in IE<9, yes, I'm aware of that and I don't consider it an "edge case." But they don't work regardless of standards/quirks mode (not without help), and the doctype doesn't affect that anyway.

  13. #13
    Settled 4 red convertible dalecosp's Avatar
    Join Date
    Jul 2002
    Location
    Accelerating Windows at 9.81 m/s....
    Posts
    7,621
    Good point; my main issue seems to be that each version's interpretation of some details differs unless you force them to use IE=EDGE, if I recall correctly.
    /!!\ mysql_ is deprecated --- don't use it! Tell your hosting company you will switch if they don't upgrade! /!!!\ ereg() is deprecated --- don't use it!

    dalecosp "God doesn't play dice." --- Einstein "Perl is hardly a paragon of beautiful syntax." --- Weedpacket

    Getting Help at All --- Collected Solutions to Common Problems --- Debugging 101 --- Unanswered Posts --- OMBE: Office Machines, Business Equipment

  14. #14
    Senior Member traq's Avatar
    Join Date
    Jun 2011
    Location
    so.Cal
    Posts
    949
    yeah.. it's a big mess. But what are ya gonna do.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •