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?
| SitePoint Sponsor |



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?

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="^$">



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.


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. ;-)
};-) http://www.xhtmlcoder.com/
Thinking Web: Voices of the Community
> March 2013 - SitePoint forums: Spot the Error 3: Calling all Sleuths! Winner Announced!... She knows how to spot simple <code> errors but do you?




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 otherBut 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.
Any posts I write in Arial are on my mobile phone, so please excuse typos etc.
Any posts I write in Verdana are on a PC, so feel free to berate me mercilessly for any mistakes
Bookmarks