Does HTML5 DOCTYPE affect how CSS3 effects are rendered?

后端 未结 4 2052
花落未央
花落未央 2020-12-07 01:58

Is there any difference how the css3 effects (for example animation) are rendered if the doctype is defined as

(html5)

or

相关标签:
4条回答
  • 2020-12-07 02:20

    There is almost no difference* between those two doctypes in terms of CSS rendering.

    The choice of doctype only affects validation, and which "browser mode" is used out of "Quirks Mode", "Standards Mode" ("no quirks mode"), "Almost Standards Mode" ("limited quirks mode").

    See: http://hsivonen.iki.fi/doctype/

    So, XHTML 1.0 Transitional gives "Almost Standards Mode", whereas <!DOCTYPE html> gives "Standards Mode".

    *One difference is a minor and easily fixable adjustment concerning tables. Another is the treatment of heading elements nested inside certain HTML5 elements.

    0 讨论(0)
  • 2020-12-07 02:22

    The doctype shouldn't affect this but there are libraries to help you determine what features are available to you in a particular client like Modernizr.

    0 讨论(0)
  • 2020-12-07 02:30

    I think that HTML5 implies in itself that the CSS improves in readibility, nothing else.

    0 讨论(0)
  • 2020-12-07 02:30

    Yes it does, and I can tell you that from personal experience.

    HTML pages which consist of sliced tables that have no cellpadding and cellspacing, fail to work with a HTML5 doctype. I had to use HTML4 transitional.

    HTML pages that use grid layout systems can sometimes work better with a HTML5 doctype. I find that the Tiny Fluid Grid does not work with a HTML4 transitional doctype.

    0 讨论(0)
提交回复
热议问题