如果我这样做:
.floatingBox div div {
text-align: center;
position: relative;
background-image: url('../images/car.png');
background-repeat: no-repeat;
background-position: center;
}
<div class='floatingBox'>
<div class='effect2'>
<a href=/Devis/moto><div class='motorbike'></div></a>
</div>
</div>
然后背景图像显示正常。
但是,如果我这样做:
.floatingBox div div {
text-align: center;
position: relative;
background-repeat: no-repeat;
background-position: center;
}
.motorbike {
background-image: url('../images/moto.png');
}
然后,背景图像不再显示。
怎么会 ?