Using import within a style attribute

后端 未结 1 1779
难免孤独
难免孤独 2021-01-06 09:22

First let me be perfectly clear. I am talking about importing a css file within a html style=\'\' attribute. You can assume Internet Explorer 9.

1条回答
  •  别那么骄傲
    2021-01-06 09:46

    The style attribute takes a list of declarations, and applies properties from that list specifically to the owner element.

    @import is not a declaration and does not apply to a particular element. It can only appear in the top level of a style sheet along with the selectors and other @-constructs that comprise the statements.

    It doesn't make any sense to import a stylesheet, that contains rules selecting other elements, into an element's inline style. It's like saying:

    
    

    which is just as meaningless.

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