ClassB具有背景颜色和背景图像,但classA仅具有背景颜色。
.classA {
background-color: #F2EDE3
background-image: url("data:image/png;base64,mydata");
background-repeat: repeat-x;
background-position: left bottom;
}
.classB {
background: #F2EDE3 url('data:image/png;base64,mydata') repeat-x left bottom;
}
答案 0 :(得分:1)
.classA
的{{3}}属性后面缺少分号:
background-color: #f2ede3;
答案 1 :(得分:0)
如果我在你的行的末尾添加分号来定义A类的背景颜色,它会起作用(减去图像作为无效):
.classA {
background-color: #F2EDE3;
background-image: url("data:image/png;base64,mydata");
background-repeat: repeat-x;
background-position: left bottom;
}
.classB {
background: #F2EDE3 url('data:image/png;base64,mydata') repeat-x left bottom;
}
<div class='classA'>aaa</div>
<div class='classB'>bbb</div>