Declare CSS style outside the “HEAD” element of an “HTML” page?

后端 未结 3 1613
北海茫月
北海茫月 2020-12-07 18:20

my use-case is the following :

I\'m composing an HTML page by using parts that are valid HTML fragments but not valid pages, like <

3条回答
  •  难免孤独
    2020-12-07 19:16

    tl;dr:

    If you're not comfortable using HTML features that haven't reached a maturity level of W3C Recommendation, there isn't a standard way of adding

    this text would be dark red

    this text would be black

    Support for the scoped feature was added to Firefox in version 21 and added in Chrome behind a flag in version 20. The feature didn't receive enough support, so it was later removed from the HTML5.1 working draft.

    Chrome was first to remove the feature in version 36. Firefox has since set the feature to be behind a flag in version 55.

    HTML 5.2

    In the July 2017 working draft of the HTML5.2 spec, support was added for the