Grow your CSS skills. Land your dream job.

Using HTML5 tags with the wrong DOCTYPE….

  • # February 26, 2013 at 11:33 am

    I’m currently working with an outdated CMS that contains the following DOCTYPE,

    < !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    Is it okay to use HTML5 tags anyway?

    # February 26, 2013 at 11:42 am

    Is there some reason why you can’t change the doctype?

    Obviously to support older IE you will have to use the shim/shiv if you do.

    # February 26, 2013 at 11:44 am

    Sadly, there’s no way for me to change it, I would if I could.

    # February 26, 2013 at 12:13 pm

    I **THINK** all the HTML5 tags need is for an HTML doctype to be declared…. I don’t think it matters what it is.

    As I said though, IE8/(9?) will need the shim/shiv.

    # February 26, 2013 at 12:44 pm

    Yes of course, I will include the shim/shiv. Thanks for the info!

    # February 26, 2013 at 3:56 pm

    I think Paulie_D is right, having any doctype is afaik enough for rendering consistently across browsers (no quirks modes). When validating you can override the doctype.

    I would however do a search in your CMS files for the doctype string and change it hardcode style :P If it’s in the generated output, it must be somewhere.

    __
    # February 26, 2013 at 11:04 pm

    Correct – the only purpose a doctype serves is to trigger “standards mode” (i.e., “not quirks mode”). *Any* doctype that starts with `< !doctype html `... will do that in all major browsers. Browsers don't even care what comes after.

    (In fact, that’s how the html5 doctype was decided upon – it’s the minimum markup required to trigger standards mode.)

Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".