css background-image coordinates - 使用什么工具?

时间:2011-08-21 02:51:13

标签: css image

查看以下图片:

enter image description here

我应该使用什么工具来获取我想要的图像部分的坐标,以便我可以在例如下面使用它:

.myimage {
    background-position: -283px -64px;
}

感谢。

3 个答案:

答案 0 :(得分:3)

几乎所有图像编辑器或查看器。甚至MS Paint(在Windows 7中)也会显示左下方选择工具的坐标。

答案 1 :(得分:2)

试试这个在线工具:http://www.spritecow.com/ 打开你的png图片,只需选择图标,sprite css就会自动生成

答案 2 :(得分:1)

如果每张图片都已导出png或jpg,您可以使用locator.codestrict.com之类的工具自动输出坐标。

您只需选择背景图像和要定位的裁剪图像,即可显示css top / left。当然,你只需要将top / left翻译成background-position。