remove / reset inherited css from an element

前端 未结 9 1307
攒了一身酷
攒了一身酷 2020-12-06 04:00

I know this question was asked before, but before marking it as a duplicate, I want to tell you that my situation is a little different from what I found on the internet.

9条回答
  •  温柔的废话
    2020-12-06 04:35

    You could try overwriting the CSS and use auto

    I don't think this will work with color specifically, but I ran into an issue where i had a parent property such as

    .parent {
       left: 0px;
    }
    

    and then I was able to just define my child with something like

    .child {
       left: auto;
    }
    

    and it effectively "reset" the property.

提交回复
热议问题