您的位置:首页 > 其它

background-position: -192px -48px;//图片定位详解

2018-06-26 13:37 696 查看
<style>
.test1{
background-image: url("./glyphicons-halflings.png");  //设置背景图(大图)
width: 16px;//设置要显示图片宽度
height: 16px;//设置要显示图片高度
background-position: -192px -48px;//图片定位,在图片当中取负值,以左上角为中心原点
}
.test2{
background-image: url("./glyphicons-halflings.png");
width: 16px;
height: 16px;
background-position: -264px -144px;
}
.test3{
background-image: url("./glyphicons-halflings.png");
width: 16px;
height: 16px;
background-position: -96px -144px;
}
</style>
<div class="test1">
</div>
<div class="test2">
</div>
<div class="test3">
</div>






最终效果图


量图软件 Mark Man
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  Mark