Reset CSS display property to default value

前端 未结 6 2033
粉色の甜心
粉色の甜心 2020-11-22 08:46

Is it possible to override the display property with its default value? For example if I have set it to none in one style, and I want to override it in a different with its

6条回答
  •  醉酒成梦
    2020-11-22 09:27

    Concerning the answer by BoltClock and John, I personally had issues with the initial keyword when using IE11. It works fine in Chrome, but in IE it seems to have no effect.

    According to this answer IE does not support the initial keyword: Div display:initial not working as intended in ie10 and chrome 29

    I tried setting it blank instead as suggested here: how to revert back to normal after display:none for table row

    This worked and was good enough for my scenario. Of course to set the real initial value the above answer is the only good one I could find.

提交回复
热议问题