important
意为 重要的
。
.app {
color: red !important;
}
#app {
color: green;
}
以上代码最终结果为红色。
在 CSS 选择器中,ID 选择器 > 类选择器,比 ID 选择器还优先的是 !important
。
important
意为 重要的
。
.app {
color: red !important;
}
#app {
color: green;
}
以上代码最终结果为红色。
在 CSS 选择器中,ID 选择器 > 类选择器,比 ID 选择器还优先的是 !important
。