这是我的代码:
<td class='buttons'><img src='images/buttons.png' alt='del' id='buttons_del' width='25' height='25'></td>
<td class='buttons'><img src='images/buttons.png' alt='add' id='buttons_del' width='25' height='25'></td>
This is a link to the image I'm using.
更新
我想选择图像的一部分而不是整个图像。
答案 0 :(得分:1)
<img src='images/buttons.png' style="position: absolute; top: 20; left: 20;" alt='del' id='buttons_del' width='25' height='25'></td>
将顶部和左侧属性更改为您需要的任何内容
答案 1 :(得分:0)
a{
display: inline-block;
width: 25px;
height: 25px;
overflow: hidden;
}
a img{
position: relative;
}
a.two img{
left: -25px;
}
a.three img{
left: -50px;
}
a.four img{
left: -75px;
}
&#13;
<body>
<a href="#" class="button one"><img src="http://i.imgur.com/y8ewSl4.png" /></a>
<a href="#" class="button two"><img src="http://i.imgur.com/y8ewSl4.png" /></a>
<a href="#" class="button three"><img src="http://i.imgur.com/y8ewSl4.png" /></a>
<a href="#" class="button four"><img src="http://i.imgur.com/y8ewSl4.png" /></a>
</body>
&#13;