css 实现图片偏移(含图片合成url)
2013-03-29 10:50
155 查看
1)css图片偏移代码如下
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebApplication11.Default" %>
<!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">
<head runat="server">
<title></title>
<style type="text/css">
.sprite-1{ background: url(Images/test.png) no-repeat; background-position: 0 0; width: 32px; height: 32px; }
.sprite-2{ background: url(Images/test.png) no-repeat; background-position: 0 -82px; width: 32px; height: 32px; }
.sprite-3{ background: url(Images/test.png) no-repeat; background-position: 0 -164px; width: 32px; height: 32px; }
.sprite-4{ background: url(Images/test.png) no-repeat; background-position: 0 -246px; width: 32px; height: 32px; }
.sprite-5{ background: url(Images/test.png) no-repeat; background-position: 0 -328px; width: 32px; height: 32px; }
.sprite-6{ background: url(Images/test.png) no-repeat; background-position: 0 -410px; width: 32px; height: 32px; }
</style>
</head>
<body>
<form id="form1" runat="server">
<div">
<ul>
<li class="sprite-1"></li>
<li class="sprite-2"></li>
<li class="sprite-3"></li>
<li class="sprite-4"></li>
<li class="sprite-5"></li>
<li class="sprite-6"></li>
</ul>
</div>
</form>
</body>
</html>
2)合成图片如下
3) 推荐合成图片网址
http://cn.spritegen.website-performance.org/
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebApplication11.Default" %>
<!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">
<head runat="server">
<title></title>
<style type="text/css">
.sprite-1{ background: url(Images/test.png) no-repeat; background-position: 0 0; width: 32px; height: 32px; }
.sprite-2{ background: url(Images/test.png) no-repeat; background-position: 0 -82px; width: 32px; height: 32px; }
.sprite-3{ background: url(Images/test.png) no-repeat; background-position: 0 -164px; width: 32px; height: 32px; }
.sprite-4{ background: url(Images/test.png) no-repeat; background-position: 0 -246px; width: 32px; height: 32px; }
.sprite-5{ background: url(Images/test.png) no-repeat; background-position: 0 -328px; width: 32px; height: 32px; }
.sprite-6{ background: url(Images/test.png) no-repeat; background-position: 0 -410px; width: 32px; height: 32px; }
</style>
</head>
<body>
<form id="form1" runat="server">
<div">
<ul>
<li class="sprite-1"></li>
<li class="sprite-2"></li>
<li class="sprite-3"></li>
<li class="sprite-4"></li>
<li class="sprite-5"></li>
<li class="sprite-6"></li>
</ul>
</div>
</form>
</body>
</html>
2)合成图片如下
3) 推荐合成图片网址
http://cn.spritegen.website-performance.org/
相关文章推荐
- canvas toDataURL转base64实现多张图片合成一个图片
- css+div+图片实现高度自适应圆角框
- CSS的障眼法:利用border实现图片的翻转【转】
- 将HTML5 Canvas的内容保存为图片借助toDataURL实现
- css实现六边形图片(最简单易懂方法实现高逼格图片展示)
- CSS实现网页图片预加载
- css实现永远居中的背景图片
- jQuery+CSS实现的图片滚动效果
- WPF实现图片合成或加水印的方法【2种方法】
- CSS实现单行图片与文字垂直居中
- Android 图片合成:添加蒙板效果 不规则相框 透明度渐变效果的实现
- CSS实现图片半透明代码
- JavaScript + CSS 实现图片放大预览效果
- 如何通过CSS实现背景图片自动平铺或拉伸至整个屏幕(自适应大小)
- 如何让背景图片实现拉伸效果,且无任何偏移(记录下,以后会用到)
- 用php实现的下载css文件中的图片的代码
- opencv2实现多张图片路线路牌(直线和圆)检测并将处理后的图片合成视频_计算机视觉大作业2
- CSS+Canvas+jQury实现图片灰度渐变效果
- 用CSS实现文字环绕图片的效果