<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>容我织梦</title>
	<atom:link href="http://www.52sonen.com/index.php/feed" rel="self" type="application/rss+xml" />
	<link>http://www.52sonen.com</link>
	<description>专注于前端开发、平面广告、网页设计</description>
	<lastBuildDate>Thu, 02 Sep 2010 06:42:01 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>如何压缩PDF文件</title>
		<link>http://www.52sonen.com/index.php/archives/898</link>
		<comments>http://www.52sonen.com/index.php/archives/898#comments</comments>
		<pubDate>Thu, 02 Sep 2010 06:42:01 +0000</pubDate>
		<dc:creator>Frog</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[Acrobat 9]]></category>
		<category><![CDATA[pdf]]></category>
		<category><![CDATA[pdf 压缩]]></category>

		<guid isPermaLink="false">http://www.52sonen.com/?p=898</guid>
		<description><![CDATA[PDF文件，其实也是经常用到的，但是从来没有想过它的文件量的大小，当大量使用时，就必须想到要控制文件量的大小。尤其是放在FTP让其它人共享，必然要——压缩PDF文件。
下面说一下我是如何操作的吧。
工欲善其事，必先利其器。首先亮出今天的武器——Adobe Acrobat 9 Professional。所以，需要先下载，然后安装。
我们知道，阅读PDF文件的软件挺多，比如Adobe Reader 9、克克PDF阅读器、福昕阅读器等，不过能够创建和修改PDF的软件，我还是推荐Adobe Acrobat 9 Professional。
点击“文件”，选择“导出”——“图像”——“JPEG”，将原来的PDF导出成n张图片。

将图片保存到一个新建的文件夹，然后利用这些保存的图片重新生成一个PDF文件。点击“创建PDF”按钮，选择“从多个文件”，然后载入之前保存的多张图片。
这一步比较关键，选择“合并文件到单个PDF”
文件载入完成后，会提示用户“另存为”，选择保存目录，给文件起一个名字，点击“保存”按钮。经过上面的步骤后，原本3兆的PDF文件，最后无损压缩为124kb，效果非常明显。
]]></description>
			<content:encoded><![CDATA[<p><span style="color: #666666;">PDF文件，其实也是经常用到的，但是从来没有想过它的文件量的大小，当大量使用时，就必须想到要控制文件量的大小。尤其是放在FTP让其它人共享，必然要——压缩PDF文件。</span></p>
<p><span style="color: #666666;">下面说一下我是如何操作的吧。</span></p>
<p><span style="color: #666666;">工欲善其事，必先利其器。首先亮出今天的武器——<strong>Adobe Acrobat 9 Professional</strong>。所以，需要先下载，然后安装。</span></p>
<p><span style="color: #666666;">我们知道，阅读PDF文件的软件挺多，比如Adobe Reader 9、克克PDF阅读器、福昕阅读器等，不过能够创建和修改PDF的软件，我还是推荐<strong>Adobe Acrobat 9 Professional</strong>。</span></p>
<p><span style="color: #666666;">点击“文件”，选择“导出”——“图像”——“JPEG”，将原来的PDF导出成n张图片。</span></p>
<p><span id="more-898"></span><span style="color: #666666;"><img class="aligncenter" title="123" src="http://www.hugesky.com/remote_pic/naps_1269744995_2.png" alt="" width="600" height="457" /></span></p>
<p><span style="color: #666666;">将图片保存到一个新建的文件夹，然后利用这些保存的图片重新生成一个PDF文件。点击“创建PDF”按钮，选择“从多个文件”，然后载入之前保存的多张图片。<img class="aligncenter" title="123" src="http://www.hugesky.com/remote_pic/naps_1269744995_3.png" alt="" width="600" height="422" /></span></p>
<p><span style="color: #666666;">这一步比较关键，选择“合并文件到单个PDF”</span></p>
<p><span style="color: #666666;"><img class="aligncenter" title="123" src="http://www.hugesky.com/remote_pic/naps_1269744995_5.png" alt="" width="600" height="488" /></span><span style="color: #666666;">文件载入完成后，会提示用户“另存为”，选择保存目录，给文件起一个名字，点击“保存”按钮。<img class="aligncenter" title="123" src="http://www.hugesky.com/remote_pic/naps_1269744995_6.png" alt="" width="600" height="351" /></span><span style="color: #666666;">经过上面的步骤后，原本3兆的PDF文件，最后无损压缩为124kb，效果非常明显。</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.52sonen.com/index.php/archives/898/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AI+CDR+FH+PSD+PDF+EPS格式文件显示缩略图补丁</title>
		<link>http://www.52sonen.com/index.php/archives/892</link>
		<comments>http://www.52sonen.com/index.php/archives/892#comments</comments>
		<pubDate>Tue, 31 Aug 2010 02:53:27 +0000</pubDate>
		<dc:creator>Frog</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[缩略图补丁]]></category>

		<guid isPermaLink="false">http://www.52sonen.com/?p=892</guid>
		<description><![CDATA[AI+CDR+FH+PSD+PDF+EPS缩略图补丁对于不是做设计的朋友可能不知道是干什么的，其实它是针对常见的设计文件格式缩略图预览的一个小补丁，该补丁可以让你的电脑在没有安装某些设计软件时通过缩略图来大概预览文件的内容，这样找寻文件方便多了，对于做设计的朋友来说应该有一定实用价值。此AI+CDR+FH+PSD+PDF+EPS缩略图补丁根据中印会员bitera1的缩略图预览补丁批处理版修改而成，增加了EPS预览功能，同时把XP版和win7版做在一起，软件自动判断系统版本，执行相应补丁。 网上也有一个类似的旧版补丁，不过据说不支持win7。此新版AI+CDR+FH+PSD+PDF+EPS缩略图补丁增加对win7的支持。
http://blog.seomaven.org/wp-content/fishup/image/AICDRFHPSDPDFEPSwin7_12A5B/View_icon.jpg
注：有一点在这说一下，AI文件如果不是PDF兼容文件，则不会显示缩略图，即使显示了，也不是里面的内容。预览PDF的电脑上要装有 Adobe Acrobat 才可以显示。
还有所谓的卸载也只是卸载了一下注册表，复制进系统的几个文件就没有删除，反正不大。 不喜勿用吧！
新版AI+CDR+FH+PSD+PDF+EPS缩略图补丁下载地址：
下载
]]></description>
			<content:encoded><![CDATA[<p>AI+CDR+FH+PSD+PDF+EPS缩略图补丁对于不是做设计的朋友可能不知道是干什么的，其实它是针对常见的设计文件格式缩略图预览的一个小补丁，该补丁可以让你的电脑在没有安装某些设计软件时通过缩略图来大概预览文件的内容，这样找寻文件方便多了，对于做设计的朋友来说应该有一定<a title="实用" href="http://blog.seomaven.org/" target="_blank">实用</a>价值。此AI+CDR+FH+PSD+PDF+EPS缩略图补丁根据中印会员bitera1的缩略图预览补丁批处理版修改而成，增加了EPS预览功能，同时把XP版和win7版做在一起，软件自动判断系统版本，执行相应补丁。 网上也有一个类似的旧版补丁，不过据说不支持win7。此新版AI+CDR+FH+PSD+PDF+EPS缩略图补丁增加对win7的支持。<span id="more-892"></span></p>
<p>http://blog.seomaven.org/wp-content/fishup/image/AICDRFHPSDPDFEPSwin7_12A5B/View_icon.jpg</p>
<p>注：有一点在这说一下，AI文件如果不是PDF兼容文件，则不会显示缩略图，即使显示了，也不是里面的内容。预览PDF的电脑上要装有 Adobe Acrobat 才可以显示。<br />
还有所谓的卸载也只是卸载了一下注册表，复制进系统的几个文件就没有删除，反正不大。 不喜勿用吧！</p>
<p>新版AI+CDR+FH+PSD+PDF+EPS缩略图补丁下载地址：<br />
<a href="http://www.52sonen.com//wp-content/uploads/20100831/AI.rar">下载</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.52sonen.com/index.php/archives/892/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>兼容ie6，firefox的css文字透明滤镜</title>
		<link>http://www.52sonen.com/index.php/archives/887</link>
		<comments>http://www.52sonen.com/index.php/archives/887#comments</comments>
		<pubDate>Tue, 24 Aug 2010 05:50:08 +0000</pubDate>
		<dc:creator>Frog</dc:creator>
				<category><![CDATA[Css]]></category>
		<category><![CDATA[css滤镜]]></category>
		<category><![CDATA[ie6]]></category>

		<guid isPermaLink="false">http://www.52sonen.com/?p=887</guid>
		<description><![CDATA[可能也有很多童鞋遇到过这样的困扰，就是透明背景上的文字的透明问题。如果背景透明，那么在背景上的文字也势必会继承背景的透明属性，这里有位达人有个好办法，请看：
样式部分：
&#60;style type=&#8221;text/css&#8221;&#62;
 #container{ border:1px solid #c00; background-color:rgba(212,0,0,0.5); *background:#f00; *filter:alpha(opacity=50); width:500px; margin:40px auto; line-height:200%; font-size:14px; padding:14px;}
 #container *{ position:relative;}
&#60;/style&#62;
代码部分：
 &#60;div id=&#8221;container&#8221;&#62;
     &#60;span&#62;我是内容我是内容我是内容我是内容&#60;/span&#62;
    &#60;/div&#62;
    &#60;p&#62;兼容ie6,ie7以及firefox的css透明滤镜，文字不继承其透明属性。&#60;/p&#62;
兼容ie6,ie7以及firefox的css透明滤镜，文字不继承其透明属性。

主要是下面这两句了，当然要用HACK了，主要是IE版本的浏览器不支持background-color的rgba这个东西，而IE只有在透明容器的子节点（文本节点除外）内设置position:relative才能不继承其父记得透明滤镜，而FF等浏览器是支持rgba这个东西的。
原文：http://www.designcss.org/web_read.php?blogid=379
]]></description>
			<content:encoded><![CDATA[<p>可能也有很多童鞋遇到过这样的困扰，就是透明背景上的文字的透明问题。如果背景透明，那么在背景上的文字也势必会继承背景的透明属性，这里有位达人有个好办法，请看：<br />
样式部分：</p>
<p>&lt;style type=&#8221;text/css&#8221;&gt;<br />
 #container{ border:1px solid #c00; background-color:rgba(212,0,0,0.5); *background:#f00; *filter:alpha(opacity=50); width:500px; margin:40px auto; line-height:200%; font-size:14px; padding:14px;}<br />
 #container *{ position:relative;}</p>
<p>&lt;/style&gt;</p>
<p><!-- 	#container{ border:1px solid #c00; background-color:rgba(212,0,0,0.5); *background:#f00; *filter:alpha(opacity=50); width:500px; margin:40px auto; line-height:200%; font-size:14px; padding:14px;} 	#container *{ position:relative;} -->代码部分：</p>
<p> &lt;div id=&#8221;container&#8221;&gt;<br />
     &lt;span&gt;我是内容我是内容我是内容我是内容&lt;/span&gt;<br />
    &lt;/div&gt;<br />
    &lt;p&gt;兼容ie6,ie7以及firefox的css透明滤镜，文字不继承其透明属性。&lt;/p&gt;</p>
<p>兼容ie6,ie7以及firefox的css透明滤镜，文字不继承其透明属性。<br />
<span id="more-887"></span><br />
主要是下面这两句了，当然要用HACK了，主要是IE版本的浏览器不支持background-color的rgba这个东西，而IE只有在透明容器的子节点（文本节点除外）内设置position:relative才能不继承其父记得透明滤镜，而FF等浏览器是支持rgba这个东西的。</p>
<p>原文：http://www.designcss.org/web_read.php?blogid=379</p>
]]></content:encoded>
			<wfw:commentRss>http://www.52sonen.com/index.php/archives/887/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>导致IE6不能正常解析CSS文件【CSS编码差异 】</title>
		<link>http://www.52sonen.com/index.php/archives/885</link>
		<comments>http://www.52sonen.com/index.php/archives/885#comments</comments>
		<pubDate>Fri, 06 Aug 2010 01:10:54 +0000</pubDate>
		<dc:creator>Frog</dc:creator>
				<category><![CDATA[Css]]></category>
		<category><![CDATA[CSS编码]]></category>

		<guid isPermaLink="false">http://www.52sonen.com/?p=885</guid>
		<description><![CDATA[可能有些童鞋在做div+css网页设计的时候突然IE6不能正常解析CSS文件，解决半天也不得其解，其实这个问题我也是遇到过的。
　　如果网页采用了 UTF-8 编码格式，这本来没有问题，问题是外部 CSS 文件默认是 ANSI 编码，并没有保存为 UTF-8 格式。可能你会发现在一般情况下这样也是没有问题的，然而当 CSS 文件中包含有中文注释时就可能不尽如人意了！估计是 IE6 版本以下的浏览器在解析这个 CSS 文件时因为编码问题而无法正确解析，所以才会发生 CSS 在 IE6 下不起作用的情况。看来微软已注意到这个问题，在 IE7 中把它修复了。
　　但是用IE6 的人还是不少。因此这个问题需要解决：
　　方法一：把 CSS、JS 和网页文件都统一保存为 UTF-8 格式。
　　方法二：去掉 CSS、JS 中的中文注释，或者改为英文。
　　上文为IE6因为编码问题无法正确解析CSS文件
　　有时候我们发现我们写的html页面引用外部css文件的时候在IE7和FF中能够很好的被解析，即能正常显示，可在IE6中却完全没有被解析，即css文件里的样式根本没应用到我们的html页面，这是怎么回事？开始我把css文件里头的所有样式都复制粘贴到html页面中的

中，这样做以后，IE6、IE7、FF都能正常显示了，这也就说明外部的css文件应该是存在什么问题了，为什么在IE6中出现这问题，而在IE7和FF中却没有？网上google了下，发现是IE6中对页面的编码有严格的要求，我查看了下，朋友发过来的css文件用的编码是GB2312的，而html文件用的是utf-8的，原来问题就出在这里了，我把css文件内容的编码用ed改成utf-8，再次测试的时候，一切恢复正常了，还有就是我发现朋友的css文件里面用中文注释，严重建议朋友们不要在css文件里面用中文来注释，这样也会引起编码的问题。 
]]></description>
			<content:encoded><![CDATA[<p>可能有些童鞋在做div+css网页设计的时候突然IE6不能正常解析CSS文件，解决半天也不得其解，其实这个问题我也是遇到过的。<br />
　　如果网页采用了 UTF-8 编码格式，这本来没有问题，问题是外部 CSS 文件默认是 ANSI 编码，并没有保存为 UTF-8 格式。可能你会发现在一般情况下这样也是没有问题的，然而当 CSS 文件中包含有中文注释时就可能不尽如人意了！估计是 IE6 版本以下的浏览器在解析这个 CSS 文件时因为编码问题而无法正确解析，所以才会发生 CSS 在 IE6 下不起作用的情况。看来微软已注意到这个问题，在 IE7 中把它修复了。<br />
　　但是用IE6 的人还是不少。因此这个问题需要解决：<br />
　　方法一：把 CSS、JS 和网页文件都统一保存为 UTF-8 格式。<br />
　　方法二：去掉 CSS、JS 中的中文注释，或者改为英文。<br />
　　上文为IE6因为编码问题无法正确解析CSS文件<br />
　　有时候我们发现我们写的html页面引用外部css文件的时候在IE7和FF中能够很好的被解析，即能正常显示，可在IE6中却完全没有被解析，即css文件里的样式根本没应用到我们的html页面，这是怎么回事？开始我把css文件里头的所有样式都复制粘贴到html页面中的<br />
<style></style>
<p>中，这样做以后，IE6、IE7、FF都能正常显示了，这也就说明外部的css文件应该是存在什么问题了，为什么在IE6中出现这问题，而在IE7和FF中却没有？网上google了下，发现是IE6中对页面的编码有严格的要求，我查看了下，朋友发过来的css文件用的编码是GB2312的，而html文件用的是utf-8的，原来问题就出在这里了，我把css文件内容的编码用ed改成utf-8，再次测试的时候，一切恢复正常了，还有就是我发现朋友的css文件里面用中文注释，严重建议朋友们不要在css文件里面用中文来注释，这样也会引起编码的问题。 </p>
]]></content:encoded>
			<wfw:commentRss>http://www.52sonen.com/index.php/archives/885/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>一个Loading效果</title>
		<link>http://www.52sonen.com/index.php/archives/881</link>
		<comments>http://www.52sonen.com/index.php/archives/881#comments</comments>
		<pubDate>Tue, 06 Jul 2010 02:00:01 +0000</pubDate>
		<dc:creator>Frog</dc:creator>
				<category><![CDATA[Life]]></category>
		<category><![CDATA[loading]]></category>

		<guid isPermaLink="false">http://www.52sonen.com/?p=881</guid>
		<description><![CDATA[
演示：Loading效果（2）

var url = 'http://www.52sonen.com';











      
      document.write("


")
        for(i=0;i&#60;60;i++)document.write("
")
      document.write("


")
      document.write("

52ssonen is loading...
页面加载中...
")
      




  



if (document.layers)
  document.write(' ');
else if (document.all &#124;&#124; document.getElementById)
  [...]]]></description>
			<content:encoded><![CDATA[<p><span id="more-881"></span>
<p style=" font-size:40px; font-weight:bolder; line-height:50px; border-bottom:3px red solid; margin-bottom:50px;">演示：Loading效果（2）</p>
<p><script language="JavaScript">
var url = 'http://www.52sonen.com';
</script></p>
</p>
<p>
<style type="text/css"></style>
</p>
<p><!-- body {     background-color: #1B1B1B; } .proccess{     border:0px  solid; border-color:#003399; width:2;height:12;background:#ffffff;margin:0     } --></p>
</p>
<p><body onLoad="location.href = url"></body></p>
<div style='margin-top:40;margin-left:40;margin-right:0'>
<div style='margin-top:-20;margin-left:0;margin-right:0' align="center">
<form method=post name=proccess>
      <script language=javascript>
      document.write("</p>
<table cellspacing=0 cellpadding=0  bordercolor='#003333' style='border:double;border-width:1px'>
<tr bgcolor=#ffffff>
<td style='font:9pt Verdana;'>")
        for(i=0;i&lt;60;i++)document.write("
<input class=proccess />")
      document.write("</td>
</tr>
</table>
<p>")
      document.write("</p>
<div id='showtime'style='font-size:9pt;color:#598F03;'></div>
<div align=center style='font-size:9pt;color:#598F03;'>52ssonen is loading...</div>
<div align=center style='font-size:9pt;color:#598F03;'>页面加载中...</div>
<p>")
      </script><br />
</form>
</div>
<div align="center">
<script language=JavaScript><!--
var elementsA=new Array(0,2,3,5,6,8,9,11,12,14);
var elementsC=new Array('#ffc7a2','#ffb17d','#ffa062','#ff8a3c','#ff6600','#ff6600','#ff8a3c','#ffa062','#ffb17d','#ffc7a2')
setInterval('ChangeColor();',1) ;
setInterval('ChangeTime();',100) ;
var minisecond=0;
var second=0;
function ChangeColor(){
for(i=0;i<elementsA.length;i++)
    {
     document.forms.proccess.elements[elementsA[i]].style.background='#ffffff';
    }
for(i=0;i<elementsA.length;i++)     {      elementsA[i]=elementsA[i]+1;      if(elementsA[i]==60){elementsA[i]=0;}      document.forms.proccess.elements[elementsA[i]].style.background=elementsC[i];     } } function ChangeTime() {    minisecond=minisecond+1     if (minisecond==10)     {minisecond=0;      second=second+1;}     document.all("showtime").innerHTML=second+"."+minisecond+" seconds"; } --></script>
  </div>
</div>
<div align="center">
<script language="javascript">
if (document.layers)
  document.write('<layer src="' + url + ' " VISIBILITY="hide"> </layer>');
else if (document.all || document.getElementById)
  document.write('<iframe src="' + url + '" style="visibility: hidden;"></iframe>');
else location.href = url;
</script>
</div>
</p>
<p style="margin-top:150px;">转载请注明出处，<a href="http://www.52sonen.com" target="_blank">52sonen</a>整理收藏</p>
]]></content:encoded>
			<wfw:commentRss>http://www.52sonen.com/index.php/archives/881/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>css断行问题</title>
		<link>http://www.52sonen.com/index.php/archives/873</link>
		<comments>http://www.52sonen.com/index.php/archives/873#comments</comments>
		<pubDate>Thu, 17 Jun 2010 06:02:33 +0000</pubDate>
		<dc:creator>Frog</dc:creator>
				<category><![CDATA[Css]]></category>
		<category><![CDATA[white-space]]></category>
		<category><![CDATA[word-break]]></category>
		<category><![CDATA[断行]]></category>

		<guid isPermaLink="false">http://www.52sonen.com/?p=873</guid>
		<description><![CDATA[　对于前端开发的童鞋来说，自动换行是个问题，正常字符的换行是比较合理的，而连续的数字和英文字符常常将容器撑大，挺让人头疼，现在总结一下CSS如何实现换行的方法，只要在CSS中定义了如下句子，可保网页不会再被撑开了。
　　对于div,p等块级元素
　　正常文字的换行(亚洲文字和非亚洲文字)元素拥有默认的white-space:normal,当定义的宽度之后自动换行

　　
        html 
　　&#60;div id=&#8221;wrap&#8221;&#62;正常文字的换行(亚洲文字和非亚洲文字)元素拥有默认的white-space:normal,当定义&#60;/div&#62;
　　css 
　　#wrap{white-space:normal; width:200px; }

　　对于IE浏览器：
　　连续的英文字符和阿拉伯数字,使用word-wrap: break-word ;或者word-break:break-all;实现强制断行
         html 
　　&#60;div id=&#8221;wrap&#8221;&#62;52sonen52sonen52sonen52sonen52sonen52sonen&#60;/div&#62;
　　css 
　　#wrap{word-break:break-all; width:200px;}
　　或者 

　　#wrap{word-wrap:break-word; width:200px;}
　 对于Firefox浏览器：
　　连续的英文字符和阿拉伯数字的断行,Firefox的所有版本的没有解决这个问题,我们只有让超出边界的字符隐藏或者,给容器添加滚动条


　　html 
　　&#60;div id=&#8221;wrap&#8221;&#62;52sonen52sonen52sonen52sonen52sonen52sonen&#60;/div&#62;
　　css 
　　#wrap{word-break:break-all; width:200px; overflow:auto;}


　　对于table元素
　　对于IE浏览器：
　　一、使用 table-layout:fixed;强制table的宽度,多余内容隐藏

&#60;table style=&#8221;table-layout:fixed&#8221; width=&#8221;200&#8243;&#62;&#60;tr&#62;&#60;td&#62;52sonen52sonen52sonen52sonen52sonen52sonen&#60;/td&#62;&#60;/tr&#62;&#60;/table&#62; 
　　二、使用 table-layout:fixed;强制table的宽度,内层td,th采用word-break : break-all;或者word-wrap : break-word ;换行 


&#60;table width=&#8221;200&#8243; style=&#8221;table-layout:fixed;&#8221;&#62;&#60;tr&#62;&#60;td width=&#8221;25%&#8221; style=&#8221;word-break : break-all; &#8221;&#62;52sonen52sonen52sonen52sonen52sonen52sonen&#60;/td&#62;&#60;td style=&#8221;word-wrap : break-word ;&#8221;&#62;52sonen52sonen52sonen52sonen52sonen52sonen&#60;/td&#62;&#60;/tr&#62;&#60;/table&#62; 

　　三、在td,th中嵌套div,p等采用上面提到的div,p的换行方法
　　对于Firefox浏览器：
　　一、使用 table-layout:fixed;强制table的宽度,内层td,th采用word-break : break-all;或者word-wrap : break-word ;换行，使用overflow:hidden;隐藏超出内，这里overflow:auto;无法起作用 
&#60;table style=&#8221;table-layout:fixed&#8221; width=&#8221;200&#8243;&#62;&#60;tr&#62; 
&#60;td width=&#8221;25%&#8221;   style=&#8221;word-break : break-all; overflow:hidden; &#8221;&#62;52sonen52sonen52sonen52sonen52sonen52sonen&#60;/td&#62; 
&#60;td width=&#8221;75%&#8221; style=&#8221;word-wrap : break-word; overflow:hidden; &#8221;&#62;52sonen52sonen52sonen52sonen52sonen52sonen&#60;/td&#62; 
&#60;/tr&#62;&#60;/table&#62; 
　　二、在td,th中嵌套div,p等采用上面提到的对付Firefox的方法。
　　最佳CSS定义换行代码 

　　.wrap { table-layout:fixed; word-break: break-all; overflow:hidden; } 

]]></description>
			<content:encoded><![CDATA[<p>　对于前端开发的童鞋来说，自动换行是个问题，正常字符的换行是比较合理的，而连续的数字和英文字符常常将容器撑大，挺让人头疼，现在总结一下CSS如何实现换行的方法，只要在CSS中定义了如下句子，可保网页不会再被撑开了。</p>
<p>　　对于div,p等块级元素<br />
　　正常文字的换行(亚洲文字和非亚洲文字)元素拥有默认的white-space:normal,当定义的宽度之后自动换行</p>
<div>
<div>　　<br />
        html <br />
　　&lt;div id=&#8221;wrap&#8221;&gt;正常文字的换行(亚洲文字和非亚洲文字)元素拥有默认的white-space:normal,当定义&lt;/div&gt;<br />
　　css <br />
　　#wrap{white-space:normal; width:200px; }</div>
</div>
<p>　　对于IE浏览器：<br />
　　连续的英文字符和阿拉伯数字,使用word-wrap: break-word ;或者word-break:break-all;实现强制断行</p>
<p>         html <br />
　　&lt;div id=&#8221;wrap&#8221;&gt;52sonen52sonen52sonen52sonen52sonen52sonen&lt;/div&gt;<br />
　　css <br />
　　#wrap{word-break:break-all; width:200px;}<br />
　　或者 </p>
<div>
<div>　　#wrap{word-wrap:break-word; width:200px;}</div>
<div>　 对于Firefox浏览器：<br />
　　连续的英文字符和阿拉伯数字的断行,Firefox的所有版本的没有解决这个问题,我们只有让超出边界的字符隐藏或者,给容器添加滚动条</div>
</div>
<div>
<div>　　html <br />
　　&lt;div id=&#8221;wrap&#8221;&gt;52sonen52sonen52sonen52sonen52sonen52sonen&lt;/div&gt;<br />
　　css <br />
　　#wrap{word-break:break-all; width:200px; overflow:auto;}</div>
</div>
<p><span id="more-873"></span><br />
　　对于table元素</p>
<p>　　对于IE浏览器：<br />
　　一、使用 table-layout:fixed;强制table的宽度,多余内容隐藏</p>
<div>
<div>&lt;table style=&#8221;table-layout:fixed&#8221; width=&#8221;200&#8243;&gt;&lt;tr&gt;&lt;td&gt;52sonen52sonen52sonen52sonen52sonen52sonen&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt; <br />
　　二、使用 table-layout:fixed;强制table的宽度,内层td,th采用word-break : break-all;或者word-wrap : break-word ;换行 </div>
</div>
<div>
<div>&lt;table width=&#8221;200&#8243; style=&#8221;table-layout:fixed;&#8221;&gt;&lt;tr&gt;&lt;td width=&#8221;25%&#8221; style=&#8221;word-break : break-all; &#8221;&gt;52sonen52sonen52sonen52sonen52sonen52sonen&lt;/td&gt;&lt;td style=&#8221;word-wrap : break-word ;&#8221;&gt;52sonen52sonen52sonen52sonen52sonen52sonen&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt; </div>
</div>
<p>　　三、在td,th中嵌套div,p等采用上面提到的div,p的换行方法</p>
<p>　　对于Firefox浏览器：<br />
　　一、使用 table-layout:fixed;强制table的宽度,内层td,th采用word-break : break-all;或者word-wrap : break-word ;换行，使用overflow:hidden;隐藏超出内，这里overflow:auto;无法起作用 </p>
<p>&lt;table style=&#8221;table-layout:fixed&#8221; width=&#8221;200&#8243;&gt;&lt;tr&gt; <br />
&lt;td width=&#8221;25%&#8221;   style=&#8221;word-break : break-all; overflow:hidden; &#8221;&gt;52sonen52sonen52sonen52sonen52sonen52sonen&lt;/td&gt; <br />
&lt;td width=&#8221;75%&#8221; style=&#8221;word-wrap : break-word; overflow:hidden; &#8221;&gt;52sonen52sonen52sonen52sonen52sonen52sonen&lt;/td&gt; <br />
&lt;/tr&gt;&lt;/table&gt; <br />
　　二、在td,th中嵌套div,p等采用上面提到的对付Firefox的方法。<br />
　　最佳CSS定义换行代码 </p>
<div>
<div>　　.wrap { table-layout:fixed; word-break: break-all; overflow:hidden; } </div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.52sonen.com/index.php/archives/873/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>适合一个人静静倾听的50首歌</title>
		<link>http://www.52sonen.com/index.php/archives/868</link>
		<comments>http://www.52sonen.com/index.php/archives/868#comments</comments>
		<pubDate>Wed, 02 Jun 2010 05:26:28 +0000</pubDate>
		<dc:creator>Frog</dc:creator>
				<category><![CDATA[Life]]></category>

		<guid isPermaLink="false">http://www.52sonen.com/?p=868</guid>
		<description><![CDATA[
刹那间生活变的那样的无趣，变得那样的阴暗，心情是那样的阴霾，身体是那样的疲惫不堪，心灵却是伤痕累累感觉好像所有的一切都成为灰烬，剩下的只有惨不忍睹的记忆和撕心裂肺的爱情，每天都活在伤感和痛苦之中，不知是我一时间对生活失去了信心还是生活在捉弄于我，感觉自己不受控制，感觉自己不属于自己，属于阴霾的天气和伤感的文字。
青春，一个人能有多少时间，是一个人一生中最美好的阶段吗，把青春献给什么？爱情吗？好像不全是，献给自己的事业，好像也不是。那青春到底给什么？难道给那些伤感和泪水吗？好像也不能是这样。那么我们的青春应该去做点什么，应该博学，慎思，慎问，明辩，然后力行，这样我们的行为就不会太出格。
爱情，一定是让你忘记了自己，迷失了自己，自己的行为和大脑不受控制，一定是让你为之付出自己全部的，而且是一个让你一生当中都受到影响的，让你一生去爱的那种感觉，所以每个人一生只能去爱一回，一个人一生只能爱一个人，其他的那些感情那是一种寂寞和孤独的懈怠，那不是爱情，那只是感觉，那只是庸俗的&#8230;所以爱情在我们的面前变的那样的美好，爱一个人，难道不该这样吗？可为什么爱情在我们面前变得那样的扑惑迷离，留下来的只有伤感和眼泪还有美好的回忆，是永远都实现不了的誓言，也可能是永远都不能在一起的代价，伤感泛滥在内心最深处。
爱情无情的走了，留下的只有回忆，只有思念，只有眼泪，只有&#8230;&#8230;那个年代。
http://www.xiami.com/song/showcollect/id/849927
]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.52sonen.com/wp-content/uploads/2010/06/126931885334931.jpg"><img class="aligncenter size-medium wp-image-870" title="12693188533493" src="http://www.52sonen.com/wp-content/uploads/2010/06/126931885334931-300x225.jpg" alt="" width="300" height="225" /></a></p>
<p>刹那间生活变的那样的无趣，变得那样的阴暗，心情是那样的阴霾，身体是那样的疲惫不堪，心灵却是伤痕累累感觉好像所有的一切都成为灰烬，剩下的只有惨不忍睹的记忆和撕心裂肺的爱情，每天都活在伤感和痛苦之中，不知是我一时间对生活失去了信心还是生活在捉弄于我，感觉自己不受控制，感觉自己不属于自己，属于阴霾的天气和伤感的文字。<span id="more-868"></span></p>
<p>青春，一个人能有多少时间，是一个人一生中最美好的阶段吗，把青春献给什么？爱情吗？好像不全是，献给自己的事业，好像也不是。那青春到底给什么？难道给那些伤感和泪水吗？好像也不能是这样。那么我们的青春应该去做点什么，应该博学，慎思，慎问，明辩，然后力行，这样我们的行为就不会太出格。</p>
<p>爱情，一定是让你忘记了自己，迷失了自己，自己的行为和大脑不受控制，一定是让你为之付出自己全部的，而且是一个让你一生当中都受到影响的，让你一生去爱的那种感觉，所以每个人一生只能去爱一回，一个人一生只能爱一个人，其他的那些感情那是一种寂寞和孤独的懈怠，那不是爱情，那只是感觉，那只是庸俗的&#8230;所以爱情在我们的面前变的那样的美好，爱一个人，难道不该这样吗？可为什么爱情在我们面前变得那样的扑惑迷离，留下来的只有伤感和眼泪还有美好的回忆，是永远都实现不了的誓言，也可能是永远都不能在一起的代价，伤感泛滥在内心最深处。<br />
爱情无情的走了，留下的只有回忆，只有思念，只有眼泪，只有&#8230;&#8230;那个年代。</p>
<p>http://www.xiami.com/song/showcollect/id/849927</p>
]]></content:encoded>
			<wfw:commentRss>http://www.52sonen.com/index.php/archives/868/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>div和span、relative和absolute、display和visibility的区别</title>
		<link>http://www.52sonen.com/index.php/archives/866</link>
		<comments>http://www.52sonen.com/index.php/archives/866#comments</comments>
		<pubDate>Thu, 20 May 2010 01:07:41 +0000</pubDate>
		<dc:creator>Frog</dc:creator>
				<category><![CDATA[Css]]></category>
		<category><![CDATA[absolute]]></category>
		<category><![CDATA[display]]></category>
		<category><![CDATA[relative]]></category>
		<category><![CDATA[visibility]]></category>

		<guid isPermaLink="false">http://www.52sonen.com/?p=866</guid>
		<description><![CDATA[div和span、relative和absolute、display和visibility是很容易混淆和弄错的HTML标签与CSS属性，今天52CSS.com简单的罗列出它们的区别与使用要点，供大家参考。
一、div和span的区别
　　div是一个块级元素，可以包含段落，表格等内容，用于放置不同的内容。一般我们在网页通过div来布局定位网页中的每个区块。
　　span是一个内联元素，没有实际意义，它的存在纯粹是为了应用样式，给一段内容加上&#60;span&#62;&#60;/span&#62;标记可以通过在span上定义样式来设定其内容的样式。
二、relative和absolute的区别
　　relative，CSS中的写法是：position:relative;  他的意思是绝对相对定位，他是参照父级的原始点为原始点，无父级则以BODY的原始点为原始点，配合TRBL进行定位，当父级内有padding等CSS属性时，当前级的原始点则参照父级内容区的原始点进行定位。
　　absolute，CSS中的写法是：position:absolute; 他的意思是绝对定位，他是参照浏览器的左上角，配合TOP、RIGHT、BOTTOM、LEFT(下面简称TRBL)进行定位，在没有设定TRBL，默认依据父级的做标原始点为原始点。如果设定TRBL并且父级没有设定position属性，那么当前的absolute则以浏览器左上角为原始点进行定位，位置将由TRBL决定。
三、display和visibility的区别
　　display:none和visibility:hidden都可以隐藏一个元素
　　但visibility:hidden只是隐藏了元素的内容，但其使用的位置空间仍然被保留。
　　而display:none则相当把元素从页面中去除，其占用位置也将被删除。
]]></description>
			<content:encoded><![CDATA[<p>div和span、relative和absolute、display和visibility是很容易混淆和弄错的HTML标签与CSS属性，今天52CSS.com简单的罗列出它们的区别与使用要点，供大家参考。</p>
<p><strong>一、div和span的区别</strong><br />
　　div是一个块级元素，可以包含段落，表格等内容，用于放置不同的内容。一般我们在网页通过div来布局定位网页中的每个区块。<br />
　　span是一个内联元素，没有实际意义，它的存在纯粹是为了应用样式，给一段内容加上&lt;span&gt;&lt;/span&gt;标记可以通过在span上定义样式来设定其内容的样式。</p>
<p><strong>二、relative和absolute的区别</strong><br />
　　relative，CSS中的写法是：position:relative;  他的意思是绝对相对定位，他是参照父级的原始点为原始点，无父级则以BODY的原始点为原始点，配合TRBL进行定位，当父级内有padding等CSS属性时，当前级的原始点则参照父级内容区的原始点进行定位。<br />
　　absolute，CSS中的写法是：position:absolute; 他的意思是绝对定位，他是参照浏览器的左上角，配合TOP、RIGHT、BOTTOM、LEFT(下面简称TRBL)进行定位，在没有设定TRBL，默认依据父级的做标原始点为原始点。如果设定TRBL并且父级没有设定position属性，那么当前的absolute则以浏览器左上角为原始点进行定位，位置将由TRBL决定。</p>
<p><strong>三、display和visibility的区别</strong><br />
　　display:none和visibility:hidden都可以隐藏一个元素<br />
　　但visibility:hidden只是隐藏了元素的内容，但其使用的位置空间仍然被保留。<br />
　　而display:none则相当把元素从页面中去除，其占用位置也将被删除。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.52sonen.com/index.php/archives/866/feed</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>DIVCSS要引起重视的10个问题</title>
		<link>http://www.52sonen.com/index.php/archives/864</link>
		<comments>http://www.52sonen.com/index.php/archives/864#comments</comments>
		<pubDate>Fri, 14 May 2010 03:16:34 +0000</pubDate>
		<dc:creator>Frog</dc:creator>
				<category><![CDATA[Css]]></category>
		<category><![CDATA[cssbug]]></category>
		<category><![CDATA[css技巧]]></category>

		<guid isPermaLink="false">http://www.52sonen.com/?p=864</guid>
		<description><![CDATA[一、检查HTML元素是否有拼写错误、是否忘记结束标记 
　　即使是老手也经常会弄错div的嵌套关系。可以用dreamweaver的验证功能检查一下有无错误。 
二、检查CSS是否正确 
　　检查一下有无拼写错误、是否忘记结尾的 } 等。可以利用CleanCSS来检查 CSS的拼写错误。CleanCSS本是为CSS减肥的工具，但也能检查出拼写错误。 
三、确定错误发生的位置 
　　假如错误影响了整体布局，则可以逐个删除div块，直到删除某个div块后显示恢复正常，即可确定错误发生的位置。 

四、利用border属性确定出错元素的布局特性 
　　使用float属性布局一不小心就会出错。这时为元素添加border属性确定元素边界，错误原因即水落石出。 
五、float元素的父元素不能指定clear属性 
　　MacIE下假如对float的元素的父元素使用clear属性，四周的float元素布局就会混乱。这是MacIE的闻名的bug，倘若不知道就会走弯路。 
六、float元素务必指定width属性 
　　很多浏览器在显示未指定width的float元素时会有bug。所以不管float元素的内容如何，一定要为其指定width属性。
七、float元素不能指定margin和padding等属性 
　　IE在显示指定了margin和padding的float元素时有bug。因此不要对float元素指定margin和padding属性（可以在float元素内部嵌套一个div来设置margin和padding）。也可以使用hack方法为IE指定非凡的值。 
八、float元素的宽度之和要小于100% 
　　假如float元素的宽度之和正好是100%，某些古老的浏览器将不能正常显示。因此请保证宽度之和小于99%。 
九、是否重设了默认的样式？ 
　　某些属性如margin、padding等，不同浏览器会有不同的解释。因此最好在开发前首先将全体的margin、padding设置为0、列表样式设置为none等。 
十、是否忘记了写DTD？ 
　　假如无论怎样调整不同浏览器显示结果还是不一样，那么可以检查一下页面开头是不是忘了写DTD。
不管您是菜鸟，还是老鸟，我觉得多看看还是有益健康的，希望能为刚学习的小盆友提供方便。
]]></description>
			<content:encoded><![CDATA[<p>一、检查HTML元素是否有拼写错误、是否忘记结束标记 <br />
　　即使是老手也经常会弄错div的嵌套关系。可以用dreamweaver的验证功能检查一下有无错误。 <br />
二、检查CSS是否正确 <br />
　　检查一下有无拼写错误、是否忘记结尾的 } 等。可以利用CleanCSS来检查 CSS的拼写错误。CleanCSS本是为CSS减肥的工具，但也能检查出拼写错误。 <br />
三、确定错误发生的位置 <br />
　　假如错误影响了整体布局，则可以逐个删除div块，直到删除某个div块后显示恢复正常，即可确定错误发生的位置。 </p>
<p><span id="more-864"></span><br />
四、利用border属性确定出错元素的布局特性 <br />
　　使用float属性布局一不小心就会出错。这时为元素添加border属性确定元素边界，错误原因即水落石出。 <br />
五、float元素的父元素不能指定clear属性 <br />
　　MacIE下假如对float的元素的父元素使用clear属性，四周的float元素布局就会混乱。这是MacIE的闻名的bug，倘若不知道就会走弯路。 <br />
六、float元素务必指定width属性 <br />
　　很多浏览器在显示未指定width的float元素时会有bug。所以不管float元素的内容如何，一定要为其指定width属性。<br />
七、float元素不能指定margin和padding等属性 <br />
　　IE在显示指定了margin和padding的float元素时有bug。因此不要对float元素指定margin和padding属性（可以在float元素内部嵌套一个div来设置margin和padding）。也可以使用hack方法为IE指定非凡的值。 <br />
八、float元素的宽度之和要小于100% <br />
　　假如float元素的宽度之和正好是100%，某些古老的浏览器将不能正常显示。因此请保证宽度之和小于99%。 <br />
九、是否重设了默认的样式？ <br />
　　某些属性如margin、padding等，不同浏览器会有不同的解释。因此最好在开发前首先将全体的margin、padding设置为0、列表样式设置为none等。 <br />
十、是否忘记了写DTD？ <br />
　　假如无论怎样调整不同浏览器显示结果还是不一样，那么可以检查一下页面开头是不是忘了写DTD。<br />
不管您是菜鸟，还是老鸟，我觉得多看看还是有益健康的，希望能为刚学习的小盆友提供方便。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.52sonen.com/index.php/archives/864/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS Sprites：真成了地沟油？</title>
		<link>http://www.52sonen.com/index.php/archives/861</link>
		<comments>http://www.52sonen.com/index.php/archives/861#comments</comments>
		<pubDate>Fri, 30 Apr 2010 08:20:55 +0000</pubDate>
		<dc:creator>Frog</dc:creator>
				<category><![CDATA[Css]]></category>
		<category><![CDATA[css sprites]]></category>
		<category><![CDATA[csssprites]]></category>

		<guid isPermaLink="false">http://www.52sonen.com/?p=861</guid>
		<description><![CDATA[



原文地址  译者：solari
无处不在的CSS sprites——是为数不多的几个可以绕过“逐渐流行”阶段，而直接让自己成为CSS最佳实践的Web设计技巧中的一个。尽管在A List Apart对它进行一个解释以及赞同认可这种方式之前，它还没有真正地流行。它最早是由Petr Stanícek.在2003年7月提出来作为一个CSS的解决方案。
Ah, the ubiquitous CSS sprites — one of the few web design techniques that was able to bypass “trend” status almost instantly, planting itself firmly into the category of best practice CSS. Although it didn’t really take off until well after A List Apart explained and endorsed it, it was [...]]]></description>
			<content:encoded><![CDATA[<div id="content">
<div id="contentwrap">
<div id="post-56"><!-- [entrymeta1] --></p>
<div>
<p><a href="http://www.smashingmagazine.com/2010/03/26/css-sprites-useful-technique-or-potential-nuisance/">原文地址</a>  译者：<a href="http://www.iamsolari.com/">solari</a></p>
<p>无处不在的CSS sprites——是为数不多的几个可以绕过“逐渐流行”阶段，而直接让自己成为CSS最佳实践的Web设计技巧中的一个。尽管在<a href="http://www.alistapart.com/">A List Apart</a>对它进行一个<a href="http://www.alistapart.com/articles/sprites/" target="_blank">解释</a>以及赞同认可这种方式之前，它还没有真正地流行。它最早是由Petr Stanícek.在2003年7月提出来作为一个CSS的解决方案。</p>
<p>Ah, the ubiquitous CSS sprites — one of the few web design techniques that was able to bypass “trend” status almost instantly, planting itself firmly into the category of best practice CSS. Although it didn’t really take off until well after A List Apart explained and endorsed it, it was discussed as a CSS solution as early as July, 2003 by Petr Stanícek.</p>
<p>当今许多web程序员对这项技巧（CSS sprites）有着很娴熟的应用能力，介绍CSS sprites的教程和文章也是不计其数。几乎在每一篇教程中，都要求设计师以及程序员应该实施CSS sprites以减少HTTP请求和节省带宽。迄今为止，这项技术已经被许多网站所应用了，包括<a rel="lightbox[56]" href="http://g-ecx.images-amazon.com/images/G/01/gno/images/orangeBlue/navPackedSprites-US-15._V202471683_.png" target="_blank">亚马逊</a>，正在使用着极大数量的sprites图片。</p>
<p>Most web developers today have a fairly strong grasp of this technique, and there have been countless tutorials and articles written on it. In almost every one of those tutorials, the claim is made that designers and developers should be implementing CSS sprites in order to minimize HTTP requests and save valuable kilobytes. This technique has been taken so far that many sites, including Amazon, now use mega sprites.</p>
<p>可是 这项技术被广泛热议的带来的好处真的值得么？设计师们是否可以在没经过仔细考虑所有方面的因素的情况下转而使用CSS sprites？在这篇文章中，我将来讨论一下CSS sprites的一些赞同或者反对使用CSS sprites的意见，尤其集中在大量使用的sprites，以及为什么这样子使用CSS sprites在许多情况下是等同于浪费时间。</p>
<p>Is this much-discussed benefit really worthwhile? Are designers jumping on the CSS sprite bandwagon without a careful consideration of all the factors? In this article, I’m going to discuss some of the pros and cons of using CSS sprites, focusing particularly on the use of “mega” sprites, and why such use of sprites could in many cases be a waste of time.</p>
<p><span id="more-861"></span></p>
<h3>浏览器缓存了所有的图像</h3>
<h3>Browsers Cache All Images</h3>
<p>拥护者们提出的一个CSS sprites的好处是页面中图片的装载时间（或者说在有许多sprites图片的情况下的单张图片的装载时间）。一张包含了所有必须的图像的GIF图片是否会拥有比相同内容的切片图像更小的文件体积？这仍然是被人争论不休的。单张GIF图片只和一个颜色表关联着，而在切片GIF模式下，每个图像都会拥有一个自己的颜色表，这样会增大文件体积。同样的，单张JPG或者PNG的sprites图像会比切片为多张图像更节省文件体积。但是这样做带来的效益会很显著么？</p>
<p>One of the benefits given by proponents of the sprite method is the load time of the images (or in the case of mega sprites, the single image). It’s argued that a single GIF image comprising all the necessary image states will be significantly lower in file size than the equivalent images all sliced up. This is true. A single GIF image has only one color table associated with it, whereas each image in the sliced GIF method will have its own color table, adding up the kilobytes. Likewise, a single JPEG or PNG sprite will likely save on file size over the same image sliced-up into multiple images. But is this really such a significant benefit?</p>
<p>默认情况下，浏览器会缓存所有的图片——不管这张图片是sprites的还是普通的。所以，尽管在使用sprites技术的时候，带宽确实会节省。但是这也只在页面第一次加载的时候回发生，当其他页面使用了相同的图片地址，浏览器会使用缓存而不是重新下载。</p>
<p>By default, image-based browsers will cache all images — whether the images are sprites or not. So, while it is certainly true that bandwidth will be saved with the sprite technique, this only occurs on the initial page load, and the caching will extend to secondary pages that use the same image URLs.</p>
<p> <a rel="lightbox[56]" href="http://www.iamsolari.com/wordpress/wp-content/uploads/2010/04/cache.gif"><img title="cache" src="http://www.iamsolari.com/wordpress/wp-content/uploads/2010/04/cache.gif" alt="" width="500" height="384" /></a></p>
<p><em>Firefox使用缓存来显示亚马逊网站的图像（你可以在地址栏输入“about:cache”来查看）。 </em></p>
<p><em>The Firefox cache displaying images from amazon.com that the browser cached (type “about:cache” in the address bar in Firefox to view this feature).</em></p>
<p>当你将上述的情况与现在互联网的速度已经比css sprites这项技术出现的时候（大约是2003年-2004年）要快得多结合起来的时候，那么就没有什么理由来使用sprites技术了。我并不是指css sprites不能被使用，而是说它们<strong>不应该被过度地使用而仅仅是为了获得有限的好处</strong>。</p>
<p>When you combine that with the fact that internet speeds are higher on average today than they were when this technique was first expounded upon in 2003-2004, then there may be little reason to use the mega sprite method. And just to be clear, as already mentioned, I’m not saying sprites should never be used; I’m saying they <strong>should not be overused to attain limited benefits</strong>.</p>
<h3>一个设计中花费在切图上的时间会增加</h3>
<h3>Time Spent Slicing a Design Will Increase</h3>
<p>想象一下一个拥有三个状态图片的按钮的sprites是如何创建的：不同的状态图片需要紧靠着其他状态图片放置着，以形成单张的图片。在你的Photoshop的原型（或者其他软件）中，你没有使不同的状态的图片以这种方式相互毗邻；它们需要被重新裁剪以及组合成一张新的独立图片，这需要在你的网站原型之外独立制作。</p>
<p>Think about how a simple 3-state image button sprite is created: The different states need to be placed next to one another, forming a single image. In your Photoshop mockup (or other software), you don’t have the different states adjacent to each other in that manner; they need to be sliced and combined into a new separate image, outside of the basic website mockup.</p>
<p>如果这时候有任何关于图片状态的修改，整个图片就都需要重新地编辑和保存。某些开发者可能没有这个烦恼。可能他们在页面原型之外还另外保存了它们的按钮状态，从而可以方便地修改。但是这样复杂的事情，远没有使用单张图片来得简单。</p>
<p>If any changes are required for any one of the image states, the entire image needs to be recompiled and resaved. Some developers may not have a problem with this. Maybe they keep their button states separate from the mockup in a raw original, making it easier to access them. But this complicates things, and will never be as simple as slicing a single image and exporting it</p>
<p>为了节省几千字节的带宽以及节省好几次服务器请求（只在页面第一次被加载的时候才会发生，其他时候都是读取浏览器缓存）这么细小的利益，sprites技术是不是真的是一项实用的解决方案呢？</p>
<p>For the minimal benefit of a few kilobytes and server requests saved (which only occurs on initial page load), is the mega sprite method really a practical solution for anything other than a 3-state button?</p>
<p> 花费在编码以及维护上的时间会增加</p>
<h3>Time Spent Coding and Maintaining Will Increase</h3>
<p>当一张sprites图片导出后，麻烦并没有消停。尽管只要你习惯了的话，将按钮sprites加入你的CSS代码中会很容易，但是其他sprites就不会这么简单了。</p>
<p>After an image is sliced and exported, the trouble doesn’t end there. While button sprites are simple to code into your CSS once you’re accustomed to the process, other kinds of sprites are not so simple.</p>
<p>一个按钮通常会是一个拥有着固定宽度的&lt;ul&gt;元素。如果按钮的sprites图片与其他按钮是独立的，那么这很简单：&lt;ul&gt;的宽度和高度会与列表元素以及锚点的宽高相同，sprites的每个状态都是对齐的。基于每个按钮的宽高，sprites的位置坐标会很容易计算。</p>
<p>A single button will usually be a &lt;ul&gt; element that has a set width. If the sprites for the button are separate for each button, it’s simple: The width and height of the &lt;ul&gt; will be the same as the width and height of the list item and anchor, with the sprite aligned accordingly for each state. The position of the sprite is easily calculated based on the height and/or width of each button.</p>
<p>但是如果放在一个大型的sprites上，比如上面说到的亚马逊使用的，或者<a rel="lightbox[56]" href="http://www.google.com/images/nav_logo7.png">Google使用的这张</a>的时候会怎样？你能想象一下维护这样一个文件，然后在CSS中修改元素的位置？还有第一次创建这些CSS代码需要花费的精力？相对于一个简单的很容易计算位置的按钮sprites，大型是sprites通常需要持续的维护代码以及重新对齐图片。</p>
<p>But what about a mega sprite, like the one used by Amazon, mentioned earlier, or <a rel="lightbox[56]" href="http://www.google.com/images/nav_logo7.png">the one used by Google</a>? Can you imagine maintaining such a file, and making changes to the position of the items in the CSS? And what about the initial creation of the CSS code? Far from being a simple button whose state positions are easily calculated, <strong>the mega sprite will often require continuous testing and realigning of the image states</strong>.</p>
<p> <a rel="lightbox[56]" href="http://www.iamsolari.com/wordpress/wp-content/uploads/2010/04/google-sprite.jpg"><img title="google-sprite" src="http://www.iamsolari.com/wordpress/wp-content/uploads/2010/04/google-sprite.jpg" alt="" width="500" height="239" /></a></p>
<p><em>部分用来排列Google的sprites图片的代码</em></p>
<p><em>Some of the CSS used to position Google’s sprite image</em></p>
<p>事实上，亚马逊使用的sprite节省了30或者更多的HTTP请求，这绝对是一个很显著的性能上的改善。但是当这个好处与开发和维护的成本，还有浏览器缓存以及互联网的速度相比起来，大面积地使用sprites就不是那么令人信服了。</p>
<p>It’s true that the Amazon sprite saves about 30 or more HTTP requests, and that is definitely a significant improvement in performance. But when that benefit is weighed against the development and maintenance costs, and the caching and internet speed issues are factored in, the decision to go with sprites in the mega format may not be so convincing.</p>
<h3><em><span style="color: #ff8000;">Sprites真的需要“维护”么？</span></em></h3>
<h3><em><span style="color: #ff8000;">Do Sprites Really Require “Maintenance”?</span></em></h3>
<p>当然，有些人认为sprites不会引起他们的头疼。在许多情况下，当一个sprites创建以及编码之后，它就很少再被修改了，而且不会受到网站维护的影响。如果你认为sprite的维护不会成为你的问题，那么最好的选择就是使用大型的sprites方法。</p>
<p>Of course, some may feel that sprites do not cause a major headache for them. In many cases, after a sprite is created and coded, it’s rarely touched again, and isn’t affected by any ongoing website maintenance. If you feel that <strong>sprite maintenance won’t be an issue for you</strong>, then the best choice may be to use the mega sprite method.</p>
<h3>不是所有东西都应该成为背景</h3>
<h3>Not Everything Should Be a Background</h3>
<p>另外一个不推荐过度使用CSS sprites的原因是它会导致开发者不正确地使用背景图像，有经验的开发者在他们的项目中会考虑到界面的可用性而找到并不是所有的图片都应该成为背景。传达重要内容的的图片应该以内嵌代码的形式实现出来，而背景图像应该在按钮或者装饰性的元素上使用。</p>
<p>Another reason not to promote the overuse of CSS sprites is that it could cause developers to use background images incorrectly. Experienced developers who consider accessibility in their projects understand that not every image should be a background. Images that convey important content should be implemented through inline images in the XHTML, whereas background images should be reserved for buttons and decorative elements.</p>
<p> <a rel="lightbox[56]" href="http://www.iamsolari.com/wordpress/wp-content/uploads/2010/04/bg-content.jpg"><img title="bg-content" src="http://www.iamsolari.com/wordpress/wp-content/uploads/2010/04/bg-content.jpg" alt="" width="500" height="416" /></a></p>
<p><em>亚马逊网站将内容图片以内嵌形式实现，装饰的图片以背景实现。</em></p>
<p><em>Amazon correctly places content images as inline elements, and decorative ones as backgrounds.</em></p>
<h2><em><span style="color: #ff8000;">不正确地使用sprites会影响到易用性</span></em></h2>
<h2><em><span style="color: #ff8000;">Improper Use of Sprites Affects Accessibility</span></em></h2>
<p> 因为CSS sprites受到了高度的重视，一些初级的开发者出于节省HTTP请求的原因，可能会不正确地推断出所有切片的图像都应该以背景图片的形式展示——即使那张图片传达了很重要的信息。这会导致站点缺乏易用性，以及限制了HTML语言中tittle和alt属性的潜在好处（译者注：丢失alt和tittle标签的一个后果，可能会导致盲人使用的专用发音上网机器无法识别出图像要传达的内容从而发音，因为这些标签都没有了）。</p>
<p>Because of the strong emphasis placed on using CSS sprites, some beginning developers intending on saving HTTP requests may incorrectly assume that all sliced images should be placed as backgrounds — even images that convey important information. <strong>The results would be a less accessible site</strong>, and would limit the potential benefits of the title and alt attributes in the HTML.</p>
<p>所以，CSS sprites其本身并没有错，而且也不会引起易用性的问题（实际上，当被正确使用的时候，他们有助于改善可用性），过度推荐使用sprites而没有辨别出好处与坏处，可能会妨碍网站在易用性以及生产力方面已经取得的成果。</p>
<p>So, while CSS sprites in and of themselves are not wrong, and do not cause accessibility problems (in fact, when used correctly, they improve accessibility), the over-promotion of sprites without clearly identifying drawbacks and correct use could hinder the progress the web has made in areas of accessibility and productivity.</p>
<h3>那HTTP请求怎么办呢？</h3>
<h3>What About HTTP Requests?</h3>
<p><a href="http://developer.yahoo.com/performance/rules.html">许多人会争论</a>，尽管减少HTTP请求是改善一个站点的性能的最重要的部分。下面这事情也应该被记住，就是一项研究表明<a href="http://yuiblog.com/blog/2007/01/04/performance-research-part-2/">40%-60%的站点的日常访客都是以空白的浏览器缓存来访</a>。这应该足够支持大型sprites应该在各种情况下使用的观点吧？也许吧。特别是当你认为第一次访问站点的访客有多重要的时候。<a href="http://developer.yahoo.com/performance/rules.html">Many will argue</a>, however (and for good reason) that the most important part of improving a site’s performance is minimizing HTTP requests. It should also be noted that one study conducted showed that<a href="http://yuiblog.com/blog/2007/01/04/performance-research-part-2/">40-60% of daily website visitors come with an empty browser cache</a>. Is this enough to suggest that mega sprites should be used in all circumstances? Possibly. Especially when you consider how important a user’s first visit to a website is.</p>
<p> <a rel="lightbox[56]" href="http://www.iamsolari.com/wordpress/wp-content/uploads/2010/04/firebug-http.jpg"><img title="firebug-http" src="http://www.iamsolari.com/wordpress/wp-content/uploads/2010/04/firebug-http.jpg" alt="" width="500" height="290" /></a></p>
<p><em>Firefox的插件YSlow可以分析显示出当前的HTTP请求数</em></p>
<p><em>The YSlow Firefox add-on that analyzes performance shows the number of HTTP requests being made</em></p>
<p>年代比较久远的浏览器一般只支持两个并发的HTTP连接，Firefox从3.0版本，IE从8开始默认<a href="http://www.stevesouders.com/blog/2008/03/20/roundup-on-parallel-connections/">支持6个并发的HTTP连接</a>。这意味着对每个服务器发出6个并发连接。Steve Souders这么说：</p>
<p>While it is true that older browsers generally only allowed two simultaneous HTTP connections, Firefox since version 3.0 and Internet Explorer 8 by default <a href="http://www.stevesouders.com/blog/2008/03/20/roundup-on-parallel-connections/">allow 6 simultaneous HTTP connections</a>. This means 6 simultaneous connections per server. To quote Steve Souders:</p>
<blockquote><p>明白这是每一个服务器的基础是很重要的。使用多个域名，比如1.mydomain.com，2.mydomain.com，3.mydomain.com等等，允许Web开发者可以以倍数增加每个服务器的连接数限制。这种做法在所有域名都是指向同一个IP地址的CNAME记录的时候仍然起效。</p></blockquote>
<blockquote><p>It’s important to understand that this is on a per server basis. Using multiple domain names, such as 1.mydomain.com, 2.mydomain.com, 3.mydomain.com, etc., allows a web developer to achieve a multiple of the per server connection limit. This works even if all the domain names are CNAMEs to the same IP address.</p></blockquote>
<p>所以，尽管现在在按钮状态之外使用CSS sprites可能还有好处，在未来，当互联网连接速度增长了，以及新版本的浏览器表现出更好的性能，使用大型sprites的好处就变得无关紧要了。</p>
<p>So, while there could be a benefit to using CSS sprites beyond just button states, in the future, as internet connection speeds increase and newer browser versions make performance improvements, <strong>the benefits that come from using mega sprites could become almost irrelevant</strong>.</p>
<p>那么Sprite生成器呢？</p>
<h3>What About Sprite Generators?</h3>
<p>大型sprites的支持者们还有另外一个观点就是sprites可以使用<a href="http://www.google.com/search?&amp;q=css+sprite+generator">sprites生成器</a>来创建。对于这些工具，在本文之外，已经有很多详细的讨论以及评测，所以我也不再赘述。但是从我对这些工具的研究上来说，<strong>它们所能提供的帮助仍然是有限的</strong>，sprites的维护仍然需要数目可观的工作时间，这与取得的好处仍然是相互冲突的。Another argument in favour of mega sprites is the apparent ease with which sprites can be created using a number of <a href="http://www.google.com/search?&amp;q=css+sprite+generator">sprite generators</a>. A detailed discussion and review of such tools is well beyond the scope of this article, so I’ll avoid that here. But from my research of these tools, the <strong></strong><strong>help they provide is limited</strong>, and maintenance of the sprites will still take a considerable amount of work, which again should be weighed against the benefits.</p>
<p><a rel="lightbox[56]" href="http://www.iamsolari.com/wordpress/wp-content/uploads/2010/04/spriteme.jpg"><img title="spriteme" src="http://www.iamsolari.com/wordpress/wp-content/uploads/2010/04/spriteme.jpg" alt="" width="500" height="198" /></a></p>
<p>有些工具，比如<a href="http://spritegen.website-performance.org/">Fondue项目</a>，提供了CSS输出的选项。Setve Souders的<a href="http://www.stevesouders.com/blog/2009/09/14/spriteme/">SpriteMe</a>工具是另外一个提供了CSS输出选项的工具。SpriteMe会将一个现有的网站的背景图像转换成一张sprite图片（这就是我曾经说的“大型”sprite），你可以下载图片以及必要的CSS代码并插入到页面中。尽管这些工具可以帮助创建sprites图片，但是它们在sprites的维护上并没有提供太多的帮助。Souders的工具在一个网站重新设计以及重新排列的时候就会显得无用了，而这个时候，能提供帮助的似乎只有还没使用大型sprite方法的设计。</p>
<p>Some tools, like <a href="http://spritegen.website-performance.org/">the one by Project Fondue</a>, offer CSS output options. Steve Souders’ tool <a href="http://www.stevesouders.com/blog/2009/09/14/spriteme/">SpriteMe</a> is another one that offers CSS coding options. SpriteMe will convert an existing website’s background images into a single sprite image (what I’ve been referring to as a “mega” sprite) that you can download and insert into your page with the necessary CSS code. While this tool will assist with the creation of sprites, <strong>it doesn’t seem to offer much help in the area of sprite maintenance</strong>. Souders’ tool seems to be useless for a website that is redesigned or realigned, and only seems to provide benefit to an existing design that has not yet used the mega sprite method.</p>
<p><a rel="lightbox[56]" href="http://www.iamsolari.com/wordpress/wp-content/uploads/2010/04/fondue.jpg"><img title="fondue" src="http://www.iamsolari.com/wordpress/wp-content/uploads/2010/04/fondue.jpg" alt="" width="500" height="111" /></a></p>
<p>这些工具在不断地改进中，未来可能会出现新的工具（来帮助创建CSS sprite）。但是有没有这种可能，在了解了上述的这些坏处之后，开发人员仍然将精力集中在这个需要很多努力，但是收益很小的事情上面呢？</p>
<p>Improvements to current tools could be made, and newer tools could appear in the future. But is it possible, due to some of the drawbacks mentioned above, that developers are focusing a lot of effort on a very minimal gain?</p>
<h3>精力应该集中在可以成倍提高性能的事情上</h3>
<h3>Focus Should be on Multiple Performance Issues</h3>
<p>如前所述，HTTP请求的数量是站点性能的一个重要因素。但是还有其他方法可以减少这个数字，包括合并脚本以及样式表，或者是使用远程地址的库文件（译者注：比如将你的jQuery库地址换成Google服务器上的jQuery库地址）。</p>
<p>As mentioned, the number of HTTP requests is an important factor to consider in website performance. But there are other ways to lower that number, including combining scripts and stylesheets, and using remote locations for library files.</p>
<p>在HTTP请求之外，开发者还有其他方面可以改善站点的性能。这些技巧包括：GZip压缩，正确的外部脚本文件的引用，优化CSS，缩小过大的JS文件，改善Ajax性能，避免使用已知的会引起性能问题的JS，还有其他的。</p>
<p>There are also <strong>areas outside of HTTP requests</strong> that a developer can focus on to improve site performance. These might include GZipping, proper placement of external scripts, optimizing CSS syntax, minifying large JavaScript files, improving Ajax performance, avoiding JavaScript syntax that’s known to cause performance issues, and much more.</p>
<p><a rel="lightbox[56]" href="http://www.iamsolari.com/wordpress/wp-content/uploads/2010/04/yslow-multiple.jpg"><img title="yslow-multiple" src="http://www.iamsolari.com/wordpress/wp-content/uploads/2010/04/yslow-multiple.jpg" alt="" width="500" height="326" /></a></p>
<p><em>YSlow指示了除了HTTP请求之外的许多可以改善网站性能的因素</em></p>
<p><em>YSlow indicates many areas outside of HTTP requests that can improve site performance</em></p>
<p>如果开发者花时间来考虑影响网站性能的所有因素，正确地衡量好处与坏处，那么应该就有个很好的理由来避免过度使用CSS sprites，以及<strong>投入更多关注在可以获得超值的性能回报的因素上面。</strong></p>
<p>If developers take the time to consider all factors in website performance, and weigh the pros and cons correctly, there may be good reason to avoid overusing CSS sprites, and <strong>focusing on areas whose performance return is worth the investment</strong>.</p>
<h2>结论</h2>
<h2>Conclusion</h2>
<p>请不要误解我在此所说的任何事情。许多顶尖的博主和开发者多年来都在赞扬使用sprites的好处，近几年来开始把这个建议推广开来，变成推荐使用大型的sprites——这些观点应该认真的考虑。尽管不是所有人都有在一个有着完整的制度和系统，可以让网站的维护工作变得简单和流水线化的公司工作的机会。我们当中的许多人都是独行侠，或者是从别人手中接过项目。在这种情况下，<strong>投入使用大型的sprites会让你入不敷出。</strong></p>
<p>Please don’t misinterpret anything that I’ve said here. Many top bloggers and developers have for years extolled the benefits of using sprites, and in recent years taken those suggestions further in promoting the use of mega sprites — so those opinions should be taken seriously. However, not everyone has the luxury of working in a company that has policies and systems in place that make website maintenance tasks simple and streamlined. Many of us work on our own, or have to inherit projects created by others. In those cases, <strong>mega sprites may cause more trouble than they’re worth</strong>.</p>
</div>
</div>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.52sonen.com/index.php/archives/861/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
