background-position:color url(image) -left -up no-repeat;
转载请注明来源:https://www.cnblogs.com/hookjc/
<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>