How to set CSS attributes to default values for a specific element (or prevent inheritance)

后端 未结 7 1199
旧时难觅i
旧时难觅i 2021-01-04 00:47

Given any HTML element that is a child of another element and is automatically inheriting a series of CSS attributes: how can you set one (or all) of those attributes to the

7条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-04 00:59

    CSS 4 CR has a provision for the revert keyword for values. It looks like intended for the exact purpose in the question and might be used like this:

    .navigation input {    
        all: revert;
    }
    

    Still its browser support is not very impressive for the time of writing...

提交回复
热议问题