Cancel a CSS declaration

后端 未结 8 1011
礼貌的吻别
礼貌的吻别 2021-02-07 08:47

Is it possible to have a CSS rule which basically \"undoes\" a prior rule?

An example:

some text more text ot
8条回答
  •  再見小時候
    2021-02-07 09:05

    I too had this question but after I glanced at the other answers it hit me,

        body {
            color : initial;
        }
    

    IE doesn't support this currently and Gecko requires a -moz-initial I believe..

        body {
            color : unset;
        }
    

    This one isn't quite as supported right now. I just thought I'd share my answer to this for anyone else who thinks about this.

提交回复
热议问题