Overriding properties in CSS

后端 未结 6 1750
忘了有多久
忘了有多久 2021-02-07 14:06
#iddiv span {
    display: inline-block;
    width: 190px;
}
.myclass {
    width:10px;
}

Then I have

<
6条回答
  •  别跟我提以往
    2021-02-07 14:44

    It's not working because the first style is more specific.

    To fix it, make sure you target the second span more directly, like this

    #iddiv span.myclass

    http://jsfiddle.net/jasongennaro/5fe9A/

提交回复
热议问题