css!important规则
!important规则用于增加样式的权重
比如:
#id {
background-color: blue;
}
.class {
background-color: gray;
}
p {
background-color: green !important;
}
尽管id选择器和类选择器具有更高的优先级,但三个段落背景颜色都会显示绿色
!important规则用于增加样式的权重
比如:
#id {
background-color: blue;
}
.class {
background-color: gray;
}
p {
background-color: green !important;
}
尽管id选择器和类选择器具有更高的优先级,但三个段落背景颜色都会显示绿色