When does CSS's !important declaration not work?

后端 未结 3 1172
执念已碎
执念已碎 2020-11-30 11:17

I am wondering if someone can put a bit of an authoritative reference summary of when the !important declaration in CSS does not work to override inline sty

3条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-11-30 11:49

    I'm pretty sure not all browsers recognise the !important declaration. But can't remember which ones do off the top of my head. Will check and get back to you.

    [EDIT] I can confirm IE6 and earlier do not recognise !important (unless the browser is in standards compliance mode - not the default).

    You can use !important to override an inline rule. But also remember that inline rules can be tagged !important as well.

提交回复
热议问题