图片无法显示在我的页面中。背景图片未加载
<div class="rating" style="width:25%;float:right;height:100px">
<span class="truckIcon">
<!-- <img src="../images/logo/favicon.png">
</span> -->
</div>
CSS:
.truckIcon{
background-image: url(../images/icons/favicon.png);no-repeat !important;
width:80px;
height:80px;
}
这是我的CSS路径:\ulmt\html\css\style.css
这是我的图片路径:\ulmt\html\images\icons\favicon.png
有什么不对吗?
它应该阅读背景:网址(“...”)不重复重要或添加背景重复:不重复的背景图像 – slashsharp
的是一个内联元素。无论是块级元素还是内联块 – Krishna9960