0.Photoshop切图

2015-06-29  本文已影响0人  Ehome

PS初始设置

PS首选项的设置
开启
保存工作区
工具
辅助试图

在“视图”菜单下开启:

补充:

sprite 图片精灵

sprite.png

在PS测量出图片宽和高位128px
测量得出每个小图标:width:128px;height:128px;
.ico这是原点的图标;
.youtobe 是一排二列 ,需要在原点显示,这图片位移坐标 x:-128px y:0;
.f 是二排四列,需要在原点显示,则图片需要位移坐标 x:-384px y:-128px;
.digg 是五排二列,需要在原点显示,则图片需要位移坐标 x:-128px y:512px;


1.jpg

CSS部分

<style type="text/css">
.ico {width:128px;height:128px;
background-image: url(sprite.png);
background-position: 0 0px ;
background-repeat: no-repeat;}
.youtobe {width:128px;height:128px;
background-image: url(sprite.png);
background-position: -128px 0px ;
background-repeat: no-repeat;}
.f {width:128px;height:128px;
background-image: url(sprite.png);
background-position: -384px  -128px ;
background-repeat: no-repeat;}
.digg {width:128px;height:128px;
background-image: url(sprite.png);
background-position: -128px -512px ;
background-repeat: no-repeat;}
</style>

html部分

<body>
    <!-- <div class="ico"></div> -->
    <!-- <div class="youtobe"></div> -->
    <!-- <div class="f"></div> -->
    <div class="digg"></div>

</body>
上一篇 下一篇

猜你喜欢

热点阅读