Commenting out stylesheets in HTML documents to support older browsers

后端 未结 1 616
旧时难觅i
旧时难觅i 2020-12-06 23:22

I\'ve been reading some fairly old books to learn CSS. I\'ve noticed that most of them recommend that style declarations to be written like this to remain backwards compatib

相关标签:
1条回答
  • 2020-12-07 00:24

    So my question is, is this still a generally suggested practice

    Only in cargo cult tutorials.

    (and is it still really used)

    Yes, but not to any useful effect. They are something that were useful in their day, and now (a decade and a half later) just won't die.

    In HTML they are useless. In XHTML they are actively harmful (since script elements don't contain implicit CDATA in XHTML so if the document is parsed as XHTML then they will act as an actual comment and hide the script from the browser).

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