Overriding css style?

后端 未结 2 2146
小鲜肉
小鲜肉 2020-12-05 04:55

I look on Stack Overflow, and didn\'t find the solution, I know how to override style if style exists, just change its property. But now I have a strange style to override <

2条回答
  •  臣服心动
    2020-12-05 05:32

    Instead of override you can add another class to the element and then you have an extra abilities. for example:

    HTML

    CSS

    //only style for the first stylesheet
    .style1 {
       width: 100%;      
    }
    //only style for second stylesheet
    .style2 {
       width: 50%;     
    }
    //override all
    .style1.style2 { 
       width: 70%;
    }
    

提交回复
热议问题