qq_美丽的曲线_03762593
2016-08-05 16:01
.task {
width: 300px;
height: 140px;
border: 1px solid #999;
background-image:url(http://static.mukewang.com/static/img/logo_index.png) no-repeat,
url(http://static.mukewang.com/static/img/logo_index.png) no-repeat;background-position:left top, 50px 50px, 100px 50px;
}
background-image属性,不支持no-repeat标签。
解决方案:
1.background-image中在去掉no-repeat标签。
2.添加
background-repeat:no-repeat,no-repeat; background-position:left top,right bottom; background-size:220px 80px,150px 50px;
属性
.task {
width: 300px;
height: 140px;
border: 1px solid #999;
background:url(http://static.mukewang.com/static/img/logo_index.png) no-repeat,
url(http://static.mukewang.com/static/img/logo_index.png) no-repeat;
background-position:0 0,100% 100%;
background-size:230px 80px,150px 55px;
}
也可以
.task {
width: 300px;
height: 140px;
border: 1px solid #999;
background:url(http://static.mukewang.com/static/img/logo_index.png) no-repeat,
url(http://static.mukewang.com/static/img/logo_index.png) no-repeat;
background-repeat:no-repeat;
background-position:left top,right bottom;
background-size:220px 80px,150px 50px;
}
这节内容前面没有讲到,这可能是课程错失。
background-position:left top, 50px 50px, 100px 50px;
定义了三组,但是 background-image只有两组
十天精通CSS3
242555 学习 · 2623 问题
相似问题