为什么背景图片不适用于.milad类的div (我使用bootstrap 4.3)
.milad {
width: 120px;
background-image: image-url('Untitled.png');
margin-top: 80px;
margin-left: 140px;
height: 120px;
}
<div class="milad"> </div>
答案 0 :(得分:2)
您的CSS属性错误,应该为url
示例:
.milad {
width: 200px;
/*put path of your image file in the url */
/*background-image: url('Untitled.png'); */
background-image: url('https://placeimg.com/640/480/nature/grayscale');
margin-top: 80px;
margin-left: 140px;
height: 200px;
}
<div class="milad"> </div>