background-position:color url(image) -left -up no-repeat;

转载请注明来源:https://www.cnblogs.com/hookjc/

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="gb2312">
<head>

<style type="text/css" >
<!--
.style1,.style2,.style3{
 float:left;
 width:162px;
 height:162px;
 background:#CCCCCC url(http://www.52css.com/attachments/month_0706/r200766232331.gif) 0 0 no-repeat;
 border:1px dotted #999999;
 color:red;
 margin-right:10px;
}
.style2{
 background-position:-50px -50px;
}
.style3{
 background-position:100px 100px;
}
.blue{
 color:blue;

}
.my
{float:left;width:100px;height:100px;
border:1px solid #FF0000;
     background:#0000FF url(http://www.52css.com/attachments/month_0706/r200766232331.gif) 50px 50px no-repeat;
}
-->
</style>
</head>
<body>
<div class="style1">
x:0,<span class="blue">y:0</span>
</div>
<div class="style2">
x:-50px,<span class="blue">y:-50px</span>
</div>
<div class="style3">
x:100px,<span class="blue">y:100px</span>
</div><br/>
<div class="my"></div>
</body>
</body>
</html>

x:0,y:0
x:-50px,y:-50px
x:100px,y:100px

X:50pxY:50px
原图片

来源:python脚本自动迁移

posted @ 2020-06-29 11:24  jiangcheng_15  阅读(116)  评论(0编辑  收藏  举报