我有这个代码:
h1, h2, h3, h4{
color: red;
}
.message_rouge h1, h2, h3, h4,{color: black;}
为什么我的所有标题都是黑色的,而不仅仅是“message_rouge”中的标题,其余的都是红色的?
谢谢 :)
我有这个代码:
h1, h2, h3, h4{
color: red;
}
.message_rouge h1, h2, h3, h4,{color: black;}
为什么我的所有标题都是黑色的,而不仅仅是“message_rouge”中的标题,其余的都是红色的?
谢谢 :)
每一行都是它自己的选择器,但您只指定.message_rouge
第一行。
改用这个:
.message_rouge h1,
.mesage_rouge h2,
.mesage_rouge h3,
.mesage_rouge h4 {
color: black;
}
这是错误的
.message_rouge h1, h2, h3, h4,{color: black;}
这是对的
.message_rouge h1,.message_rouge h2,.message_rouge h3,.message_rouge h4,{color: black;}