SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Evangelist
    Join Date
    Jul 2004
    Location
    England
    Posts
    588
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Effect of <!DOCTYPE html> on rendering

    I've been using a <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> to trigger standards mode.

    Will a switch to <!DOCTYPE html> cause problems?

  2. #2
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,604
    Mentioned
    24 Post(s)
    Tagged
    1 Thread(s)
    It shouldn't do - they are both versions of the strict Doctype and so both should put the CSS and JavaScript code into standards mode.
    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="^$">

  3. #3
    SitePoint Evangelist
    Join Date
    Jul 2004
    Location
    England
    Posts
    588
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by felgall View Post
    It shouldn't do - they are both versions of the strict Doctype and so both should put the CSS and JavaScript code into standards mode.
    Good-o. That's what I'd hoped - but hadn't been able to confirm by what I'd read so far.

  4. #4
    Non-Member bronze trophy
    Join Date
    Nov 2009
    Location
    Keene, NH
    Posts
    3,760
    Mentioned
    23 Post(s)
    Tagged
    0 Thread(s)
    If you look here:
    http://msdn.microsoft.com/library/ms535242(VS.85).aspx

    there's a chart halfway down that shows that IE will go into standards mode on a unrecognized doctype even without the URL. That's why the HTML 5 lip-service doctype actually works. It's actually invalid, but that's why it does what it does...

    Beware though that Netscape 6 will be in quirks mode with the 5 doctype -- not that anyone in their right mind is still using that.

    Though my question would be, why do you want the steaming pile of manure that is 5 in the first place? -- but that's me.

  5. #5
    Robert Wellock silver trophybronze trophy xhtmlcoder's Avatar
    Join Date
    Apr 2002
    Location
    A Maze of Twisty Little Passages
    Posts
    6,316
    Mentioned
    60 Post(s)
    Tagged
    0 Thread(s)
    Off Topic:

    Why? Because Fred automatically makes all your code the most semantic in the world without even doing anything and super-dooper and other stuff and gets you loads of fans and amazing SEO results and works 100% perfectly in all browsers ever made and those that haven't. Or that's what the fan-boys would make you believe. ;-)

  6. #6
    SitePoint Evangelist
    Join Date
    Jul 2004
    Location
    England
    Posts
    588
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by deathshadow60 View Post
    If you look here:
    http://msdn.microsoft.com/library/ms535242(VS.85).aspx

    there's a chart halfway down that shows that IE will go into standards mode on a unrecognized doctype even without the URL. That's why the HTML 5 lip-service doctype actually works. It's actually invalid, but that's why it does what it does...

    Beware though that Netscape 6 will be in quirks mode with the 5 doctype -- not that anyone in their right mind is still using that.

    Though my question would be, why do you want the steaming pile of manure that is 5 in the first place? -- but that's me.
    Thanks. And for 'why?'... insn't that the way to go?

  7. #7
    Mouse catcher silver trophy
    Stevie D's Avatar
    Join Date
    Mar 2006
    Location
    Yorkshire, UK
    Posts
    5,830
    Mentioned
    110 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by gulliver View Post
    Thanks. And for 'why?'... insn't that the way to go?
    People said that about XHTML2. People said that about Betamax. New doesn't always equal better.

    At the moment, there's precious little reason to even think about using HTML5. Inline form validation for non-critical forms is one of the very few advantages it offers for the time being. A short and easy-to-remember doctype is the other But the fact that some mainstream browsers don't natively support HTML5 features means that using them now is either (a) doomed to failure, as some people won't be able to use your site, or (b) extra effort, putting workarounds in place to make sure they can. Neither of which seem like good strategies.

    What HTML5 doesn't offer is any kind of rigid enforcement of what a lot of people here would consider 'good practice'. That doesn't mean that you can't do the right thing, it just means that you don't have to. It introduces a lot of new elements that don't seem to be particularly necessary, and leaves in others that it should have taken out.

    But this isn't the place for a detailed discussion of HTML5, there's plenty of that already going on.


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
  •