文章来源:https://www.toymoban.com/news/detail-568737.html
文章来源地址https://www.toymoban.com/news/detail-568737.html
.img-box{
display:flex;
margin-top:10px;
width :100%;
height:450px;
border:1px solid red;
.divImg{
width: 300px;
height:300px;
background: url(../assets/images/test.png) center center no-repeat;
margin-right:10px;
border:1px solid blue;
&.shu{
background: url(../assets/images/test2.png) center center no-repeat;
}
&.bz1{
background-size: 100%;
}
&.bz2{
background-size: 100% 100%;
color:yellow;
}
&.cover{
background-size: cover;
color:yellow;
}
&.contain{
background-size: contain;
}
}
.imgIcon{
width:500px;
height:400px;
}
.imgIcon2{
width:300px;
height:500px;
}
}
到了这里,关于给div添加背景图片时查看图片样式-设置background-size属性的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!