<?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>5ivedance &#187; css</title>
	<atom:link href="http://5ivedance.com/tag/css/feed/" rel="self" type="application/rss+xml" />
	<link>http://5ivedance.com</link>
	<description>Sincerity</description>
	<lastBuildDate>Fri, 16 Apr 2010 08:39:40 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Web Design &#8211; HTML5 &amp; CSS3 Checklist</title>
		<link>http://5ivedance.com/development/web-design-html5-css3-checklist/</link>
		<comments>http://5ivedance.com/development/web-design-html5-css3-checklist/#comments</comments>
		<pubDate>Thu, 25 Mar 2010 16:07:38 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[html]]></category>

		<guid isPermaLink="false">http://5ivedance.com/?p=1462</guid>
		<description><![CDATA[Web Design &#8211; HTML5 &#38; CSS3 Checklist


新窗口打开下图
Download  HTML 5 Visual Cheat Sheet
]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.findmebyip.com/litmus/" target="_blank">Web Design &#8211; HTML5 &amp; CSS3 Checklist</a></p>
<p><a rel="lightbox" href="http://5ivedance.com/wp-content/uploads/2010/03/Web-Design-HTML5-CSS3-Checklist.gif" rel="lightbox[g1462]"><img class="alignnone size-full wp-image-1463" title="Web-Design---HTML5-&amp;-CSS3-Checklist" src="http://5ivedance.com/wp-content/uploads/2010/03/Web-Design-HTML5-CSS3-Checklist.jpg" alt="" width="500" height="246" /></a></p>
<p><span id="more-1462"></span></p>
<p><a href="http://5ivedance.com/wp-content/uploads/2010/03/Web-Design-HTML5-CSS3-Checklist.gif" target="_blank">新窗口打开下图</a></p>
<p><strong><a href="http://woorkup.com/wp-content/uploads/2009/12/HTML5-Visual-Cheat-Sheet.pdf">Download  HTML 5 Visual Cheat Sheet</a></strong></p>
]]></content:encoded>
			<wfw:commentRss>http://5ivedance.com/development/web-design-html5-css3-checklist/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>若干IEbug及解决方案</title>
		<link>http://5ivedance.com/development/how-to-fix-several-internet-explorer-6-bugs/</link>
		<comments>http://5ivedance.com/development/how-to-fix-several-internet-explorer-6-bugs/#comments</comments>
		<pubDate>Thu, 28 Jan 2010 08:09:19 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[选择符]]></category>

		<guid isPermaLink="false">http://5ivedance.com/?p=1249</guid>
		<description><![CDATA[这篇东西写了很久，大概半个月了，开始想详尽的写完所有的IEbug，但是要回家了，暂时先把这些放出来吧。写的过程参考了很多文章，比以前明白了很多东西，也发现了很多不知道的问题，如果您看完了，发现任何错误疑点、任何意见观点可以评论或者发邮件给我。
命中注定总有一个浏览器作为复仇女神来到世界各地的开发者中，在web标准运动初期，这个角色是Netscape Navigator 4，垂死挣扎就是不肯死去，阻碍着现代标准的进程；今天这个角色被Internet Explorer 6这位邪恶的坏同学代替了。——Jeremy Keith


盒模型（The Box Model）
我这里把盒模型真正给丫立体化（特殊到正方体了怎么样）：
有一个正方体宝贝比如是传说中象征永恒的水晶，为了保护它需要一个精美的盒子。为了防止碰撞，在盒子和水晶之间预留了空间来放海绵。在盒子外面再加一层泡沫塑料，也是为了防止水晶磕磕碰碰。我们现在把这宝贝一边的宽度定位width:60px(可以假想为60cm)，盒子里面的海绵厚度padding:15px（也就是说海绵厚度为15cm），盒子的皮厚border:5px（包装够结实——5cm厚），那需要的盒子边长就是60+2*15+2*5=100px（盒子的边长是100cm），水晶盒子外面的泡沫塑料是margin:10px（外面再包10cm厚的泡沫，结实！盒模型的问题和它无关，先把他撕下来扔掉好了-__-）

对于标准的盒模型来说：他们的盒子是看到的实际的盒子，是包含了海绵和水晶的盒子。但是早期的IE看到的只是字面意思上的width。
解决方案：
在HTML页面里面加入完整的&#60;!DOCTYPE&#62;，IE6会切换到近似乎标准的模式，这样IE6就会正确的解释盒模型。如果你不这样做，也可以在定义了width的元素里面不用padding和border，在被封闭的元素里面随意的运用。
我一般解决这个问题的方法是，不在boxes里面用只在layout用.如果box里面有文字在
标签里，我会在p元素直接用padding，跳过这个问题，但是这是可行的。——css-tricks
双边距问题（Double-Margin）
几乎所有的有些经验但经验不足的同学都遇到过这个悲剧的现象，浮动div嵌套着用的不亦乐乎，margin-padding此起彼伏。定了个div想和外部的div保持距离，就在里面的div来个margin，这时候就产生了传说中丑名远播的双边距问题：
未修正代码：

#selector{
width:200px;
height:50px;
float:left;
margin:5px 20px;
border:#00a6cc;
}


修正代码：

#selector{
width:200px;
height:50px;
float:left;
margin:5px 20px;
border:#00a6cc;
      display:inline;/*hi,-___-kill the double margin bug*/
}

在做BI十周年的时候我在父元素用了padding，在IE6标准模式下这样做也是一种办法。
最小/大宽/高（min-width/max-width and min-height/max-height）
IE6不能解释最小最大宽高，其实我觉得这用的不太多。对图片在站点中的重要问题有很多不知道，以后会慢慢学习。很多时候缩略图都是生成的图片，大幅图片直接缩小感觉会比较糟糕。
但是IE6会像标准浏览器解释min-width（min-height）一样解释width（height），所以可以利用IE6不能识别的!important或者其他IE6不能识别的高级选择符来hack：

#selector{
min-width:100px;
width:auto !important;/*IE6区分无法识别*/
width:100;
}


#selector{
min-width:100px;
width:100;
}
html>body #slector{/*IE6区分无法识别-IE7?*/
height:auto;
}

因为IE6把width/height处理了min-width/min-height，所以max-width/max-height没办法这样做了，所幸IE有自己的私有属性expressions，但是这个东西严重影响浏览器性能，但是还是摘来看看：

/*写给 IE6 的max-width*/
* html div.max-width {
  width: expression(document.body.clientWidth > 499 ? "500px" : "auto");
}
/*写给标准浏览器的 max-width*/
div.max-width {
  max-width: 500px;
}

max-width

/*写给 IE6 的max-height*/
* html div.max-height {
  height: expression(this.scrollHeight > 499 ? "500px" [...]]]></description>
			<content:encoded><![CDATA[<p>这篇东西写了很久，大概半个月了，开始想详尽的写完所有的IEbug，但是要回家了，暂时先把这些放出来吧。写的过程参考了很多文章，比以前明白了很多东西，也发现了很多不知道的问题，如果您看完了，发现任何错误疑点、任何意见观点可以评论或者<a href="http://5ivedance.com/about/#contact" target="_blank">发邮件</a>给我。</p>
<blockquote><p>命中注定总有一个浏览器作为复仇女神来到世界各地的开发者中，在web标准运动初期，这个角色是Netscape Navigator 4，垂死挣扎就是不肯死去，阻碍着现代标准的进程；今天这个角色被Internet Explorer 6这位邪恶的坏同学代替了。——<a rel="me" href="http://adactio.com/">Jeremy Keith</a>
</p></blockquote>
<p><span id="more-1249"></span></p>
<h3>盒模型（The Box Model）</h3>
<p>我这里把盒模型真正给丫立体化（特殊到正方体了怎么样）：</p>
<blockquote><p>有一个正方体宝贝比如是传说中象征永恒的水晶，为了保护它需要一个精美的盒子。为了防止碰撞，在盒子和水晶之间预留了空间来放海绵。在盒子外面再加一层泡沫塑料，也是为了防止水晶磕磕碰碰。我们现在把这宝贝一边的宽度定位width:60px(可以假想为60cm)，盒子里面的海绵厚度padding:15px（也就是说海绵厚度为15cm），盒子的皮厚border:5px（包装够结实——5cm厚），那需要的盒子边长就是60+2*15+2*5=100px（盒子的边长是100cm），水晶盒子外面的泡沫塑料是margin:10px（外面再包10cm厚的泡沫，结实！盒模型的问题和它无关，先把他撕下来扔掉好了-__-）</p></blockquote>
<p><img src="http://5ivedance.com/wp-content/uploads/2010/01/The-Box-Model.gif" alt="The-Box-Model" title="The-Box-Model" width="500" height="378" class="alignnone size-full wp-image-1259" /></p>
<p>对于标准的盒模型来说：他们的盒子是看到的实际的盒子，是包含了海绵和水晶的盒子。但是早期的IE看到的只是字面意思上的width。</p>
<h4>解决方案：</h4>
<p>在HTML页面里面加入完整的&lt;!DOCTYPE&gt;，IE6会切换到近似乎标准的模式，这样IE6就会正确的解释盒模型。如果你不这样做，也可以在定义了width的元素里面不用padding和border，在被封闭的元素里面随意的运用。</p>
<blockquote><p>我一般解决这个问题的方法是，不在boxes里面用只在layout用.如果box里面有文字在
<p>标签里，我会在p元素直接用padding，跳过这个问题，但是这是可行的。——css-tricks</p></blockquote>
<h3>双边距问题（Double-Margin）</h3>
<p>几乎所有的有些经验但经验不足的同学都遇到过这个悲剧的现象，浮动div嵌套着用的不亦乐乎，margin-padding此起彼伏。定了个div想和外部的div保持距离，就在里面的div来个margin，这时候就产生了传说中丑名远播的双边距问题：</p>
<p>未修正代码：</p>
<pre name="code" class="css">
#selector{
width:200px;
height:50px;
float:left;
margin:5px 20px;
border:#00a6cc;
}
</pre>
<p><img src="http://5ivedance.com/wp-content/uploads/2010/01/the-double-margin.gif" alt="" title="the-double-margin" width="500" height="400" class="alignnone size-full wp-image-1266" /></p>
<p>修正代码：</p>
<pre name="code" class="css">
#selector{
width:200px;
height:50px;
float:left;
margin:5px 20px;
border:#00a6cc;
      display:inline;/*hi,-___-kill the double margin bug*/
}
</pre>
<p>在做BI十周年的时候我在父元素用了padding，在IE6标准模式下这样做也是一种办法。</p>
<h3>最小/大宽/高（min-width/max-width and min-height/max-height）</h3>
<p>IE6不能解释最小最大宽高，其实我觉得这用的不太多。对图片在站点中的重要问题有很多不知道，以后会慢慢学习。很多时候缩略图都是生成的图片，大幅图片直接缩小感觉会比较糟糕。</p>
<p>但是IE6会像标准浏览器解释min-width（min-height）一样解释width（height），所以可以利用IE6不能识别的!important或者其他IE6不能识别的高级选择符来hack：</p>
<pre name="code" class="css">
#selector{
min-width:100px;
width:auto !important;/*IE6区分无法识别*/
width:100;
}
</pre>
<pre name="code" class="css">
#selector{
min-width:100px;
width:100;
}
html>body #slector{/*IE6区分无法识别-IE7?*/
height:auto;
}
</pre>
<p>因为IE6把width/height处理了min-width/min-height，所以max-width/max-height没办法这样做了，所幸IE有自己的私有属性expressions，但是这个东西严重影响浏览器性能，但是还是摘来看看：</p>
<pre name="code" class="css">
/*写给 IE6 的max-width*/
* html div.max-width {
  width: expression(document.body.clientWidth > 499 ? "500px" : "auto");
}
/*写给标准浏览器的 max-width*/
div.max-width {
  max-width: 500px;
}
</pre>
<p><em>max-width</em></p>
<pre name="code" class="css">
/*写给 IE6 的max-height*/
* html div.max-height {
  height: expression(this.scrollHeight > 499 ? "500px" : "auto");
}
/*写给标准浏览器的 max-height*/
div.max-height {
  max-height: 500px;
}
</pre>
<p><em>max-height</em></p>
<blockquote>
<h3>高级选择符可参考之前的一些文章</h3>
<ul>
<li><a href="http://5ivedance.com/development/css-selector-1-attribute-selectors/">CSS选择符之一属性选择符</a></li>
<li><a href="http://5ivedance.com/development/css-selector-2-child-selector/">CSS选择符之二子对象选择符</a></li>
</ul>
</blockquote>
<h3>清除浮动</h3>
<p>首先我们来看看什么时候会遇到这个问题，来看初始的html结构和css（下面的测试将会在Firefox3.5以及IETester中的IE6和win系统版IE8/IE7兼容模式进行）：</p>
<pre name="code" class="css">
body{
color:#da444f;/*为了让字变色*/
}
*{
margin:0;
padding:0;/*一个小小的cssReset*/
}
.wrap{
border:1px solid #da444f;
background:#e4faff;
width:350px;/*添加不添加这个宽度呢，先填上*/
padding:10px;/*添加这个是为了边框和内容有点点距离*/
}
.column-left{
border:1px solid #00a6cc;
background:#ffdddf;
width:150px;
height:100px;
}
.column-right{
margin-left:10px;
border:1px solid #00a6cc;
background:#ffdddf;
width:150px;
height:100px;
}
</pre>
<pre name="code" class="html">
<div class="wrap">
<div class="column-left">column-left</div>
<div class="column-right">column-right</div>
</div>
</pre>
<p>此时的显示无差异，均如下图所示：</p>
<p><img src="http://5ivedance.com/wp-content/uploads/2010/01/no-float.gif" alt="" title="no-float" width="500" height="295" class="alignnone size-full wp-image-1287" /></p>
<h4>不清楚浮动是怎么样的情况：</h4>
<p>这个样子显然不是设计所需要的，两栏布局应该是一左一右并排才是。这时候不得不添加<code>float:left;</code>。在添加浮动我想多做一下测试，到底会有什么不同？单在左栏添加、单在右栏添加、两栏同时添加。</p>
<p><strong>先看单在左栏添加的状况</strong>，此时左栏样式添加了float:left：</p>
<pre name="code" class="css">
.column-left{
        float:left;
border:1px solid #00a6cc;
background:#ffdddf;
width:150px;
height:100px;
}
</pre>
<p>这时候IE6显示如下：</p>
<p><img src="http://5ivedance.com/wp-content/uploads/2010/01/only-left-float-ie6.gif" alt="" title="only-left-float-ie6" width="500" height="196" class="alignnone size-full wp-image-1288" /></p>
<p>IE7显示如下：</p>
<p><img src="http://5ivedance.com/wp-content/uploads/2010/01/only-left-float-ie7.gif" alt="" title="only-left-float-ie7" width="500" height="196" class="alignnone size-full wp-image-1289" /></p>
<p>IE8和FF3.5显示和相同，如下：</p>
<p><img src="http://5ivedance.com/wp-content/uploads/2010/01/only-left-float-ie8-ff.gif" alt="" title="only-left-float-ie8-ff" width="500" height="196" class="alignnone size-full wp-image-1290" /></p>
<p>可以看出IE67那抽风的样子，完全不可理喻，其他结论先不提。<br />
<strong>下面再测试单在右栏添加float:left;：</strong></p>
<pre name="code" class="css">
.column-right{
        float:left;
border:1px solid #00a6cc;
background:#ffdddf;
width:150px;
height:100px;
}
</pre>
<p>这次IE6显示如下：</p>
<p><img src="http://5ivedance.com/wp-content/uploads/2010/01/only-right-float-ie6.gif" alt="" title="only-right-float-ie6" width="500" height="293" class="alignnone size-full wp-image-1291" /><br />
（这里插播一则国际新闻：这个刚才为什么为什么这个和下面的不一样，包括刚才那个，其实呢，这个也是前文提到的双边距bug，这里只要在column-right加上display:inline;就可以解决了）<br />
IE7显示：</p>
<p><img src="http://5ivedance.com/wp-content/uploads/2010/01/only-right-float-ie7.gif" alt="" title="only-right-float-ie7" width="500" height="293" class="alignnone size-full wp-image-1293" /></p>
<p>IE8和FF3.5显示相同（实际上文字的字母的距离以及IE文字毛茸茸的样子是因为IE对字体进行了特殊的处理），如下</p>
<p><img src="http://5ivedance.com/wp-content/uploads/2010/01/only-right-float-ie8-ff.gif" alt="" title="only-right-float-ie8-ff" width="500" height="293" class="alignnone size-full wp-image-1294" /></p>
<p><strong>下面将测试左右栏都添加float:left;的情况：</strong></p>
<p>IE6/7显示相同为：</p>
<p><img src="http://5ivedance.com/wp-content/uploads/2010/01/all-float-ie6.gif" alt="" title="all-float-ie6" width="500" height="183" class="alignnone size-full wp-image-1295" /></p>
<p>IE8/FF显示为：</p>
<p><img src="http://5ivedance.com/wp-content/uploads/2010/01/all-float-ie8-ff.gif" alt="" title="all-float-ie8-ff" width="500" height="183" class="alignnone size-full wp-image-1296" /></p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-休息一下，来个分割线&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p>有同学好奇的发现：<span style="color:red;font-weight:bold;">在没有添加任何清除浮动的情况下，IE6/7显示的是正确的！只有FF3.5/IE8才有问题！</span>这是因为另外一个应该被人知道的微软私有属性<span style="color:red;font-weight:bold;">hasLayout</span>搞的鬼。这里简单的介绍下：IE67支持这个东西，这个属性会被一些诸如width:*px的属性激活，激活这个东西IE会突然听话很多，更多介绍先推荐一篇翻译文章<a href="http://bbs.blueidea.com/thread-2636904-1-1.html" target="_blank">[译文]On having layout</a>，其他的请看参考文章。这个属性到IE8就不支持了，所以上边最后的测试显示IE8,FF得到了我们预料的悲剧。我开始为了截图方便在.wrap添加了width:350px的属性。</p>
<p>下面再来看看<strong>没有这个width:350px的时候，左右都不添加浮动的情况</strong>，样式如下：</p>
<pre name="code" class="css">
body{
color:#da444f;/*为了让字变色*/
}
*{
margin:0;
padding:0;/*一个小小的cssReset*/
}
.wrap{
border:1px solid #da444f;
background:#e4faff;
/*此处去掉width:350px*/
padding:10px;
}
.column-left{
border:1px solid #00a6cc;
background:#ffdddf;
width:150px;
height:100px;
}
.column-right{
margin-left:10px;
border:1px solid #00a6cc;
background:#ffdddf;
width:150px;
height:100px;
}
</pre>
<p>浏览器均显示为：<br />
<a rel="lightbox" href="http://5ivedance.com/wp-content/uploads/2010/01/no-float-no-wrap-width.gif" rel="lightbox[g1249]"><img src="http://5ivedance.com/wp-content/uploads/2010/01/no-float-no-wrap-width-500x119.gif" alt="" title="no-float-no-wrap-width" width="500" height="119" class="alignnone size-medium wp-image-1304" /></a><br />
此时右栏在IE6并没有出现双边距问题，因为它不是浮动元素，其他单栏测试省略。<br />
再来测试双栏添加float:left;wrap不设宽度，浏览器均如下所示：<br />
<a rel="lightbox" href="http://5ivedance.com/wp-content/uploads/2010/01/all-float-no-wrap-width.gif" rel="lightbox[g1249]"><img src="http://5ivedance.com/wp-content/uploads/2010/01/all-float-no-wrap-width-500x86.gif" alt="" title="all-float-no-wrap-width" width="500" height="86" class="alignnone size-medium wp-image-1305" /></a><br />
再来测试双栏添加float:left;不设wrap宽度不设wrap内边距：（这样对比下，更直观）<br />
<a rel="lightbox" href="http://5ivedance.com/wp-content/uploads/2010/01/all-float-no-wrap-width-no-padding.gif" rel="lightbox[g1249]"><img src="http://5ivedance.com/wp-content/uploads/2010/01/all-float-no-wrap-width-no-padding-500x86.gif" alt="" title="all-float-no-wrap-width-no-padding" width="500" height="86" class="alignnone size-medium wp-image-1307" /></a></p>
<p>说了这么多，自己越来越清晰，但不知道这样能不能讲明白，但是测试浮动会出很多状况。所以，传说<strong>浮动会产生一堆变态问题，那绝对是个事实</strong>！这个时候就会遇到怎么处理这些浮动的问题了。</p>
<h4>解决方案——怎么清除浮动：</h4>
<p>清除之后如图所示：</p>
<p><a rel="lightbox" href="http://5ivedance.com/wp-content/uploads/2010/01/all-float-clear.gif" rel="lightbox[g1249]"><img src="http://5ivedance.com/wp-content/uploads/2010/01/all-float-clear-500x86.gif" alt="" title="all-float-clear" width="500" height="86" class="alignnone size-medium wp-image-1312" /></a></p>
<p><strong>附加标签</strong></p>
<p>W3C推荐的方法就是这个方法，这个方法在浮动元素末尾添加一个空标签：</p>
<pre name="code" class="html">
<br style="clear:both;" />
</pre>
<p>或者div之类的也可以</p>
<pre name="code" class="html">
<xxx style="clear:both;"></xxx>
</pre>
<p>这样添加额外的结构，如果不介意有些多余的结构也不会有任何问题。</p>
<p><strong>clearfix</strong></p>
<p>将下面代码写入css，在包含content的div加入clearfix：</p>
<pre name="code" class="css">
.clearfix:after {
  content: " ";
  display: block;
  height: 0;
  clear: both;
  visibility: hidden;
}

.clearfix { display: inline-table; }

/* Hides from IE-mac \*/
* html .clearfix {height: 1%;}
.clearfix { display: block; }
/* End hide from IE-mac */
</pre>
<p>像下面这样</p>
<pre name="code" class="html">
<div class="wrap">
<div class="column-left">column-left</div>
<div class="column-right">column-right</div>
</div>
</pre>
<blockquote>
<h3>参考文章</h3>
<ul>
<li><a href="http://www.sitepoint.com/blogs/2009/03/06/10-fixes-for-ie6-problems/">10 Fixes That Solve IE6 Problems</a></li>
<li><a href="http://net.tutsplus.com/tutorials/html-css-techniques/solving-5-common-css-headaches/">Solving 5 Common CSS Headaches</a></li>
<li><a href="http://net.tutsplus.com/tutorials/html-css-techniques/9-most-common-ie-bugs-and-how-to-fix-them/">9 Most Common IE Bugs and How to Fix Them</a></li>
<li><a href="http://sixrevisions.com/web-development/definitive-guide-to-taming-the-ie6-beast/">Definitive Guide to Taming the IE6 Beast</a></li>
<li><a href="http://www.dustindiaz.com/min-height-fast-hack/">Min-Height Fast Hack</a></li>
<li><a href="http://perishablepress.com/press/2008/02/05/lessons-learned-concerning-the-clearfix-css-hack/">Lessons Learned Concerning the Clearfix CSS Hack</a></li>
<li><a href="http://www.positioniseverything.net/easyclearing.html">Clearing a float container without source markup</a></li>
</ul>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://5ivedance.com/development/how-to-fix-several-internet-explorer-6-bugs/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>在IE主流时代诗意地编码（四）</title>
		<link>http://5ivedance.com/development/support-internet-explorer-still-be-cutting-edge-4/</link>
		<comments>http://5ivedance.com/development/support-internet-explorer-still-be-cutting-edge-4/#comments</comments>
		<pubDate>Thu, 14 Jan 2010 15:04:09 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[选择符]]></category>

		<guid isPermaLink="false">http://5ivedance.com/?p=1203</guid>
		<description><![CDATA[工具集
Modernizr

如果你使用高级CSS属性，Modernizr 将是一个非常有用小型JavaScript。它为你的页面html标签添加一些类（class），来测试浏览器是否支持一些特定的CSS属性，像：

 * @font-face
* rgba()
* hsla()
* border-image
* border-radius
* box-shadow
* Multiple backgrounds
* opacity
* CSS animations
* CSS columns
* CSS gradients
* CSS reflections
* CSS 2-D transforms
* CSS 3-D transforms
* CSS transitions
比如border-image，当一个页面加载到的浏览器支持它，将会返回borderimage，如果浏览器不支持将返回no-borderimage。
Modernizr 不会使不支持这些属性的浏览器变的支持，但是给出的重要信息（在表单里的类）是可以用在样式表里面——引用独立选择符和属性到元素。
IE-7.js
IE-7.js使得IE5+的行为像IE8,支持更多的高级选择符并修复了部分渲染bug，这里有部分来自creator’s websitee的摘录：

添加了高级选择符的支持：
 &#62;, + and ~; attribute selectors; :hover, :active, :focus for all elements; :first-child, :last-child,   nly-child, :nth-child, :nth-last-child; :checked, :disabled, :enabled; :empty, :not; :before, [...]]]></description>
			<content:encoded><![CDATA[<h3>工具集</h3>
<h4>Modernizr</h4>
<p><a href="http://www.modernizr.com/"><img class="alignnone size-full wp-image-1204" title="15modernizr" src="http://5ivedance.com/wp-content/uploads/2010/01/15modernizr.jpg" alt="" width="500" height="217" /></a></p>
<p>如果你使用高级CSS属性，<a href="http://www.modernizr.com/">Modernizr</a> 将是一个非常有用小型JavaScript。它为你的页面html标签添加一些类（class），来测试浏览器是否支持一些特定的CSS属性，像：<br />
<span id="more-1203"></span></p>
<ul> * @font-face<br />
* rgba()<br />
* hsla()<br />
* border-image<br />
* border-radius<br />
* box-shadow<br />
* Multiple backgrounds<br />
* opacity<br />
* CSS animations<br />
* CSS columns<br />
* CSS gradients<br />
* CSS reflections<br />
* CSS 2-D transforms<br />
* CSS 3-D transforms<br />
* CSS transitions</ul>
<p>比如border-image，当一个页面加载到的浏览器支持它，将会返回borderimage，如果浏览器不支持将返回no-borderimage。</p>
<p>Modernizr 不会使不支持这些属性的浏览器变的支持，但是给出的重要信息（在表单里的类）是可以用在样式表里面——引用独立选择符和属性到元素。</p>
<h4>IE-7.js</h4>
<p><a href="http://code.google.com/p/ie7-js/">IE-7.js</a>使得IE5+的行为像IE8,支持更多的高级选择符并修复了部分渲染bug，这里有部分来自<a href="http://dean.edwards.name/IE7/">creator’s website</a>e的摘录：</p>
<blockquote>
<p>添加了高级选择符的支持：</p>
<pre name="code" class="html"> <code>&gt;</code>, <code>+</code> and <code>~</code>; attribute selectors; <code>:hover</code>, <code>:active</code>, <code>:focus</code> for all elements; <code>:first-child</code>, <code>:last-child</code>, <code> <img src='http://5ivedance.com/wp-includes/images/smilies/icon_surprised.gif' alt=':o' class='wp-smiley' /> nly-child</code>, <code>:nth-child</code>, <code>:nth-last-child</code>; <code>:checked</code>, <code>:disabled</code>, <code>:enabled</code>; <code>:empty</code>, <code>:not</code>; <code>:before</code>, <code>:after</code>, <code>:content</code>; <code>:lang</code>
</pre>
</p>
<p>使用标准盒模型。</p>
<p>支持 <code>min-</code> 和 <code>max-width</code> 还有 <code>-height</code>.</li>
<p>支持PNG alpha透明（但是没解决PNG背景重复和背景定位时的问题）。</p>
</blockquote>
<p>缺点是这个技术需要可运行javascript的环境，这是不幸的。所以，小心给那些设置js不可用的用户可接受的站点版本，特别是一些脚本不能执行，或者最坏的情况是，缺少JavaScript将破坏站点的设计。</p>
<h3>实例</h4>
<p>常言道，说起来容易做起来难。所以，我们用一些优秀的例子将刚才提到这些新东西付诸实践。这是一些我们访问的在不同浏览器渲染结果不同的网站。在某些情况下，差别显而易见，但是开发人员选择接受这些不同。</p>
<h4>Twitter</h4>
<p><a href="http://twitter.com/"><img src="http://5ivedance.com/wp-content/uploads/2010/01/16twitter-1.jpg" alt="" title="16twitter-1" width="500" height="323" class="alignnone size-full wp-image-1208" /></a><br />
<em>Twitter &#8211; Firefox </em><br />
<a href="http://twitter.com/"><img src="http://5ivedance.com/wp-content/uploads/2010/01/16twitter-2.jpg" alt="" title="16twitter-2" width="500" height="329" class="alignnone size-full wp-image-1209" /></a><br />
<em>Twitter &#8211; IE6</em></p>
<h4>WordPress</h4>
<p><a href="http://wordpress.org/"><img src="http://5ivedance.com/wp-content/uploads/2010/01/17wordpress-1.jpg" alt="" title="17wordpress-1" width="500" height="301" class="alignnone size-full wp-image-1210" /></a><em>WordPress &#8211; Firefox</em><br />
<a href="http://wordpress.org/"><img src="http://5ivedance.com/wp-content/uploads/2010/01/17wordpress-2.jpg" alt="" title="17wordpress-2" width="500" height="301" class="alignnone size-full wp-image-1211" /></a><em>WordPress &#8211; IE6</em></p>
<h4>WWF</h4>
<p><a href="http://panda.org/"><img src="http://5ivedance.com/wp-content/uploads/2010/01/18wwf-1.jpg" alt="" title="18wwf-1" width="500" height="238" class="alignnone size-full wp-image-1212" /></a><br />
<em>WWF &#8211; Firefox</em><br />
<img src="http://5ivedance.com/wp-content/uploads/2010/01/18wwf-2.jpg" alt="" title="18wwf-2" width="500" height="238" class="alignnone size-full wp-image-1213" /><br />
<em>WWF &#8211; IE6</em></p>
<h3>总结</h3>
<p>记得写这篇文章的初衷是想教大家怎么样hack IE还有处理它的缺陷甚至如何利用JavaScript实现效果。（现在）恰恰相反，这是篇解释设计建立站点需要知道的跨浏览器差异。</p>
<p>你没有看到过用户因为看到Twitter或者WordPress没有圆角而引起的暴动吧；他们甚至没有感到失落，因为那些差异<br />
基本没有破坏站点。人民仍然可以使用站点获得良好体验。大多数情况下，他们甚至没注意到这些！</p>
<p>所有我们需要做的是客气但严谨的向客户解释，这样就是不断进化的web的贡献。</p>
<h3>目录</h3>
<blockquote><ul>
<li><a href="http://5ivedance.com/development/support-internet-explorer-still-be-cutting-edge-1/">在IE主流时代诗意地编码（一）</a></li>
<li><a href="http://5ivedance.com/development/support-internet-explorer-still-be-cutting-edge-2/">在IE主流时代诗意地编码（二）</a></li>
<li><a href="http://5ivedance.com/development/support-internet-explorer-still-be-cutting-edge-3/">在IE主流时代诗意地编码（三）</a></li>
<li><a href="http://5ivedance.com/development/support-internet-explorer-still-be-cutting-edge-4/">在IE主流时代诗意地编码（四）</a></li>
<li>本文译自 Smashing Magazin [ <a href="http://www.smashingmagazine.com/2009/12/01/how-to-support-internet-explorer-and-still-be-cutting-edge/"> 英文原文</a> ]</li>
</ul>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://5ivedance.com/development/support-internet-explorer-still-be-cutting-edge-4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>在IE主流时代诗意地编码（三）</title>
		<link>http://5ivedance.com/development/support-internet-explorer-still-be-cutting-edge-3/</link>
		<comments>http://5ivedance.com/development/support-internet-explorer-still-be-cutting-edge-3/#comments</comments>
		<pubDate>Wed, 13 Jan 2010 13:59:35 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[css]]></category>

		<guid isPermaLink="false">http://5ivedance.com/?p=1193</guid>
		<description><![CDATA[CSS 主要的区别是外观层面的
这将面临的问题是最好不管那些不支持（新技术的）的浏览器，因为即便缺乏支持对用户浏览内容毫无影响。
这样主要会用到一些新CSS3属性，比如 border-radius， text-shadow 还有border-image。
Border-radius
这是设计师在不考虑IE以为学习到的第一个CSS3属性，因为它明确的美化属性。用border-radius的时候，最好不要试图在IE里复制相同的效果，让它随意吧。



Gowalla在他们网站运用了border-radius，但是IE用户看不到这个效果。
哪些浏览器不支持？所以的IE，Opera也是。
Font-face
在IE里面可以使用Font-face，但是你需要利用Microsoft’s Web Embedding Fonts tool来转换你的字体。

如果想让的站点包含字体和格式工具，CSS应该添加以下结构：

@font-face {
	  font-family: "Delicious";
	  src: url("Delicious-Roman.eot");
	  src: local("Delicious"), url("Delicious-Roman.otf") format("opentype");
}

通常，浏览器不能渲染一堆字体中的第一个字体时，不应该破坏页面或任何方面出现阻挠用户浏览内容的问题。所以，这里推荐仔细考虑想让用户看到的那些字体，如果浏览器不支持font-face，应该依赖那些在样式表中声明的字体。


如果浏览器不支持font-face直接显示下一个可用的字体
多栏（Multiple Columns）
与其建立额外的浮动DIV来组织你的文字到分栏，不如利用CSS3的多栏属性自动建立分栏。但这意味着一些浏览器将会看不到。
多栏被很好的用于文字，而不是设计。如果在站点使用它们，最坏的情况是用户将看到一行很长的文字。
如果你只是处理简短的文字，为什么不直接在两分钟内用它搞定呢？但是如果减损可读内容
，你最好的选择是坚持用常规的DIV来建立分栏。


这里，引导文字是用了CSS multiple columns。IE用户将会看到常规的单栏文字。
哪些浏览器不支持？IE和Opera.
RGBa and Opacity
RGBa颜色是福祉般的恩惠。与其努力的为背景更新PNG文件，可以用CSS3创建相同的透明效果。但是IE做不到。IE6甚至不知道PNGs为何物。
安全的方案是，这些透明层不可以经常在覆盖着重要内容的元素上使用；在这种情况下，首先保证内容不可以被其他元素遮挡。
所以，当使用RGBa颜色时，确保在RGBs前面包含一个常规颜色，这样当浏览器不能读出它时仍然有备用颜色：

div {
	background-color:  #FFFFFF;
	background-color: rgba(255,255,255,.5);
}

透明在IE可以用Opacity滤镜实现，但是IE滤镜只在设计的元素上可用：

div {
	filter: alpha(opacity = 50);
}

另外，注意Opacity比RGBa颜色工作更复杂：所以这个DIV包含的元素将会“被透明化”。


24ways狠狠的用了RGBa颜色和alpha透明，尽管IE不能渲染透明。
那些浏览器不支持？所有浏览器支持opacity,条件是提供滤镜。IE不支持RGBa颜色。
Text-shadow
一个简单的要求：忽略它。假定文字仍然具有可读性，相对CSS而已试图用其他任何方法建立文字阴影（text-shadow）都是一项巨大的工程。所以除非失去阴影会影响大面积文字（或者一小部分，可以用图片代替）的清晰度，不用它是良好的选择。（译者没读懂这部分意思，大大们来看看This is an easy call: ignore it. Assuming that the text is still readable, trying to recreate text-shadow any other way than [...]]]></description>
			<content:encoded><![CDATA[<h3>CSS 主要的区别是外观层面的</h3>
<p>这将面临的问题是最好不管那些不支持（新技术的）的浏览器，因为即便缺乏支持对用户浏览内容毫无影响。</p>
<p>这样主要会用到一些新CSS3属性，比如 border-radius， text-shadow 还有border-image。</p>
<h4>Border-radius</h4>
<p>这是设计师在不考虑IE以为学习到的第一个CSS3属性，因为它明确的美化属性。用border-radius的时候，最好不要试图在IE里复制相同的效果，让它随意吧。<br />
<span id="more-1193"></span><br />
<a href="http://gowalla.com/"><img src="http://5ivedance.com/wp-content/uploads/2010/01/08gowalla-1.jpg" alt="" title="08gowalla-1" width="449" height="155" class="alignnone size-full wp-image-1178" /></a><br />
<a href="http://gowalla.com/"><img src="http://5ivedance.com/wp-content/uploads/2010/01/08gowalla-2.jpg" alt="" title="08gowalla-2" width="449" height="155" class="alignnone size-full wp-image-1179" /></a><br />
<em>Gowalla在他们网站运用了border-radius，但是IE用户看不到这个效果。</em></p>
<p>哪些浏览器不支持？所以的IE，Opera也是。</p>
<h4>Font-face</h4>
<p>在IE里面可以使用Font-face，但是你需要利用<a href="http://www.microsoft.com/typography/WEFT.mspx">Microsoft’s Web Embedding Fonts tool</a>来转换你的字体。<br />
<img src="http://5ivedance.com/wp-content/uploads/2010/01/09microsoft-tool.jpg" alt="" title="09microsoft-tool" width="500" height="247" class="alignnone size-full wp-image-1180" /></p>
<p>如果想让的站点包含字体和格式工具，CSS应该添加以下结构：</p>
<pre name="code" class="css">
@font-face {
	  font-family: "Delicious";
	  src: url("Delicious-Roman.eot");
	  src: local("Delicious"), url("Delicious-Roman.otf") format("opentype");
}
</pre>
<p>通常，浏览器不能渲染一堆字体中的第一个字体时，不应该破坏页面或任何方面出现阻挠用户浏览内容的问题。所以，这里推荐仔细考虑想让用户看到的那些字体，如果浏览器不支持font-face，应该依赖那些在样式表中声明的字体。</p>
<p><a href="http://elliotjaystocks.com/"><img src="http://5ivedance.com/wp-content/uploads/2010/01/10elliot-1.jpg" alt="" title="10elliot-1" width="500" height="151" class="alignnone size-full wp-image-1181" /></a><br />
<a href="http://elliotjaystocks.com/"><img src="http://5ivedance.com/wp-content/uploads/2010/01/10elliot-2.jpg" alt="" title="10elliot-2" width="500" height="122" class="alignnone size-full wp-image-1182" /></a><br />
<em>如果浏览器不支持font-face直接显示下一个可用的字体</em></p>
<h4>多栏（Multiple Columns）</h4>
<p>与其建立额外的浮动DIV来组织你的文字到分栏，不如利用CSS3的多栏属性自动建立分栏。但这意味着一些浏览器将会看不到。</p>
<p>多栏被很好的用于文字，而不是设计。如果在站点使用它们，最坏的情况是用户将看到一行很长的文字。</p>
<p>如果你只是处理简短的文字，为什么不直接在两分钟内用它搞定呢？但是如果减损可读内容<br />
，你最好的选择是坚持用常规的DIV来建立分栏。<br />
<a href="http://yaili.com/"><img src="http://5ivedance.com/wp-content/uploads/2010/01/11yaili-1.jpg" alt="" title="11yaili-1" width="500" height="126" class="alignnone size-full wp-image-1183" /></a><br />
<a href="http://yaili.com/"><img src="http://5ivedance.com/wp-content/uploads/2010/01/11yaili-2.jpg" alt="" title="11yaili-2" width="500" height="127" class="alignnone size-full wp-image-1184" /></a><br />
<em>这里，引导文字是用了CSS multiple columns。IE用户将会看到常规的单栏文字。</em></p>
<p>哪些浏览器不支持？IE和Opera.</p>
<h4>RGBa and Opacity</h4>
<p>RGBa颜色是福祉般的恩惠。与其努力的为背景更新PNG文件，可以用CSS3创建相同的透明效果。但是IE做不到。IE6甚至不知道PNGs为何物。</p>
<p>安全的方案是，这些透明层不可以经常在覆盖着重要内容的元素上使用；在这种情况下，首先保证内容不可以被其他元素遮挡。</p>
<p>所以，当使用RGBa颜色时，<strong>确保在RGBs前面包含一个常规颜色</strong>，这样当浏览器不能读出它时仍然有备用颜色：</p>
<pre name="code" class="html">
div {
	background-color:  #FFFFFF;
	background-color: rgba(255,255,255,.5);
}
</pre>
<p>透明在IE可以用Opacity滤镜实现，但是IE滤镜只在设计的元素上可用：</p>
<pre name="code" class="html">
div {
	filter: alpha(opacity = 50);
}
</pre>
<p>另外，注意Opacity比RGBa颜色工作更复杂：所以这个DIV包含的元素将会“被透明化”。</p>
<p><a href="http://24ways.org/"><img src="http://5ivedance.com/wp-content/uploads/2010/01/12_24ways-1.jpg" alt="" title="12_24ways-1" width="500" height="189" class="alignnone size-full wp-image-1185" /></a><br />
<a href="http://24ways.org/"><img src="http://5ivedance.com/wp-content/uploads/2010/01/12_24ways-2.jpg" alt="" title="12_24ways-2" width="500" height="189" class="alignnone size-full wp-image-1186" /></a></p>
<p><em>24ways狠狠的用了RGBa颜色和alpha透明，尽管IE不能渲染透明。</em></p>
<p>那些浏览器不支持？所有浏览器支持opacity,条件是提供滤镜。IE不支持RGBa颜色。</p>
<h4>Text-shadow</h4>
<p>一个简单的要求：忽略它。假定文字仍然具有可读性，相对CSS而已试图用其他任何方法建立文字阴影（text-shadow）都是一项巨大的工程。所以除非失去阴影会影响大面积文字（或者一小部分，可以用图片代替）的清晰度，不用它是良好的选择。（译者没读懂这部分意思，大大们来看看This is an easy call: ignore it. Assuming that the text is still readable, trying to recreate text-shadow any other way than with CSS is a Herculean task. So, unless missing text-shadow would seriously reduce the clarity of a large amount of text, or a small amount (in which case you could use image replacement), you’re better off without it.）<br />
<a href="http://brokersdirect.net/"><img src="http://5ivedance.com/wp-content/uploads/2010/01/13brokersdirect-1.jpg" alt="" title="13brokersdirect-1" width="500" height="103" class="alignnone size-full wp-image-1197" /></a><br />
<a href="http://brokersdirect.net/"><img src="http://5ivedance.com/wp-content/uploads/2010/01/13brokersdirect-2.jpg" alt="" title="13brokersdirect-2" width="500" height="103" class="alignnone size-full wp-image-1198" /></a><br />
<em>在IE下，Broker Direct站点白色文字阴影是看不到的</em></p>
<p>那些浏览器不支持？IE。</p>
<h4>边框图片Border-image</h4>
<p>border-image属性给我们一种为元素添加漂亮边框的简单方法，否则那将是噩梦般的事情（这也是大多数情况我们可能不选择这样做）。</p>
<p>因为这个属性几乎总是用来美化，最佳的选择是为不支持该属性的浏览器包含一个备选——普通边框属性，并且在这之后为其他浏览器添加附加样式。</p>
<p><a href="http://www.blog.spoongraphics.co.uk/"><img src="http://5ivedance.com/wp-content/uploads/2010/01/14spoongraphics-1.jpg" alt="" title="14spoongraphics-1" width="499" height="152" class="alignnone size-full wp-image-1199" /></a><br />
<a href="http://www.blog.spoongraphics.co.uk/"><img src="http://5ivedance.com/wp-content/uploads/2010/01/14spoongraphics-2.jpg" alt="" title="14spoongraphics-2" width="499" height="152" class="alignnone size-full wp-image-1200" /></a><br />
SpoonGraphics使用了border-image，但是IE不可见。</p>
<p>哪些浏览器不支持？相反的回答更简单：到现在为止，只有Safari和Firefox支持这个属性。</p>
<h4>多背景图（Multiple Backgrounds）</h4>
<p>这个属性的使用在于站点的设计，但大多数情况，缺乏第二甚至第三个背景不会影响可读性。</p>
<p>CSS的多背景图（Multiple Backgrounds）解决了一大堆因使用不同html hooks和嵌套元素来完成相同效果所产生的头疼问题。所以，如果你选择使用多背景图，你已经选择哪个浏览器可以显示结果。</p>
<p>如果让所有的用户都看到背景图很重要的话，使用旧办法——为不同的元素添加不同的背景吧。</p>
<p>如果也不这样，最好的措施是给那些不支持的浏览器以备选方案：选择你认为最重要的或者最适合全局设计的背景图，在多背景（Multiple Backgrounds）属性前面添加旧属性。不支持的浏览器会忽略第二个属性。</p>
<p>哪些浏览器不支持？IE，Opera，Firefox3.6+。</p>
<h3>目录</h3>
<blockquote><ul>
<li><a href="http://5ivedance.com/development/support-internet-explorer-still-be-cutting-edge-1/">在IE主流时代诗意地编码（一）</a></li>
<li><a href="http://5ivedance.com/development/support-internet-explorer-still-be-cutting-edge-2/">在IE主流时代诗意地编码（二）</a></li>
<li><a href="http://5ivedance.com/development/support-internet-explorer-still-be-cutting-edge-3/">在IE主流时代诗意地编码（三）</a></li>
<li><a href="http://5ivedance.com/development/support-internet-explorer-still-be-cutting-edge-4/">在IE主流时代诗意地编码（四）</a></li>
<li>本文译自 Smashing Magazin [ <a href="http://www.smashingmagazine.com/2009/12/01/how-to-support-internet-explorer-and-still-be-cutting-edge/"> 英文原文</a> ]</li>
</ul>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://5ivedance.com/development/support-internet-explorer-still-be-cutting-edge-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>在IE主流时代诗意地编码（二）</title>
		<link>http://5ivedance.com/development/support-internet-explorer-still-be-cutting-edge-2/</link>
		<comments>http://5ivedance.com/development/support-internet-explorer-still-be-cutting-edge-2/#comments</comments>
		<pubDate>Tue, 12 Jan 2010 13:39:24 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[css]]></category>

		<guid isPermaLink="false">http://5ivedance.com/?p=1188</guid>
		<description><![CDATA[重置（浏览器默认属性）
如你所知，所以的浏览器对各种html元素都具有不同的默认属性。这是为什么使用重置样式文件（Reset style sheet）是一个明智选择，这样我们就可以在“一张白纸”（去掉了众多浏览器默认属性，可以让你自己的属性更好的工作）上面开始工作了。
众多充斥互联网的重置样式文件各有优劣。Eric Meyer的重置文件被广泛的认为标准并被经常使用，还有其他一些演化的版本。(如果不能看到这个页面，可以直接下载这个文件css-reset.txt)


随着HTML5的出现，在CSS重置文件（Reset style sheet）中包含新HTML元素也是个好主意。html5doctor为Eric的重置文件提供了一个很好的升级版本，你可以在你的项目里面免费使用它。

在使用CSS reset的时候，既可以嵌入你自己的CSS文件头部也可以从外部引入——如果你有代码洁癖：

@import url(reset.css);

不同的CSS可能破坏你的布局
如果你觉得使用Universal IE6 CSS，你刚省去了很多头疼的事情。但是不要被IE7、8那个鲜亮的logo迷惑了你：如果你打算用最新的CSS技术，还要为它们做很多事情。
IE6 和PNG支持
大家都知道IE6不能正确显示alpha通道透明PNG图片（也就是那个好看的i.e. the good-looking ones——我又囧了），看到过精心制作的logo出现那个讨厌的淡蓝色背景。
你可以在一些为了是IE6显示PNG而做的变通方法中做个选择。每个方法都相当容易实施，并且在整体设计中做到不相同？（这句不知道怎么翻，大大们帮忙下——Each is fairly quick to implement and does make a difference in the overall design.）
这里是一些解决这个问题的优秀脚步和技术：


DD_belatedPNG


Supersleight jQuery Plugin


PNG 8-bit technique (Fireworks)


Clever PNG Optimization Techniques


PNG Optimization Guide: More Clever Techniques



值得注意的是当前越来越多的网页设计选择不去为IE6解决PNG问题：

最新改版的31three没有用任何方法为IE6解决PNG问题
高级选择符
这些选择符几乎是他们自己开发的最优雅的CSS，因为他们才拥有CSS真正的力量——可以使得作为开发者的我们，人生变的更简单（我们的预算也会显著降低！）。
是否决定让它们在IE工作，主要取决于我们在哪里用到它们。
比如，如果利用它们来添加更多的细节到设计中，像代表文件类型的精致图标，如果有些浏览器不显示他们不会带来很大的区别。站点的访客不会知道他们错过了什么，链接任然完整可用。
这些选择符也被广泛的运用到提升排版细节，缺少对它们的支持不会给你的设计带来很大的问题。


Hicksdesign在导航菜单的项目号码里面使用了高级选择符，对IE6用户而言它们是不可见的
哪些浏览器不支持这个？实际上IE6看不到样式文件提交的任何高级选择符。它仅能理解简单的父子层级的类（classes）和ID选择符。多个类提交到同一个元素（HTML标签）甚至会冲突！不能信任IE6。
IE7忽略 :lang 选择符和伪元素（pseudo-elements），比如 :first-line ，:first-letter， :before，还有 :after 。但是可以理解所以的属性选择符。
另外，迄今为止发布的所有IE（作为译者的我：就是IE8和IE8-）版本都不支持伪类 :target ，UI元素声明伪类（:enabled， :disabled，等），结构伪类（像 :nth-child :nth-of-type还有 :first-child）或者负伪元素。
盒模型规则
盒规则允许为一个元素设置任何需要的宽和高（盒规则允许你告诉你浏览器你期望的元素宽和高）。
比如，可以设置 box-sizing [...]]]></description>
			<content:encoded><![CDATA[<h3>重置（浏览器默认属性）</h3>
<p>如你所知，所以的浏览器对各种html元素都具有不同的默认属性。这是为什么使用重置样式文件（Reset style sheet）是一个明智选择，这样我们就可以在“一张白纸”（去掉了众多浏览器默认属性，可以让你自己的属性更好的工作）上面开始工作了。</p>
<p>众多充斥互联网的重置样式文件各有优劣。<a href="http://meyerweb.com/eric/thoughts/2007/05/01/reset-reloaded/" target="_blank">Eric Meyer</a>的重置文件被广泛的认为标准并被经常使用，还有其他一些演化的版本。(如果不能看到这个页面，可以直接下载这个文件<em><a href='http://5ivedance.com/wp-content/uploads/2010/01/css-reset.txt'>css-reset.txt</a></em>)</p>
<p><a href="http://meyerweb.com/eric/thoughts/2007/05/01/reset-reloaded/"><img src="http://5ivedance.com/wp-content/uploads/2010/01/04ericmeyer.jpg" alt="" title="04ericmeyer" width="500" height="356" class="alignnone size-full wp-image-1170" /></a><br />
<span id="more-1188"></span><br />
随着HTML5的出现，在CSS重置文件（Reset style sheet）中包含新HTML元素也是个好主意。<a href="http://html5doctor.com/html-5-reset-stylesheet/">html5doctor</a>为Eric的重置文件提供了一个很好的升级版本，你可以在你的项目里面免费使用它。</p>
<p><a href="http://html5doctor.com/html-5-reset-stylesheet/"><img src="http://5ivedance.com/wp-content/uploads/2010/01/05html5doctor.jpg" alt="" title="05html5doctor" width="500" height="340" class="alignnone size-full wp-image-1171" /></a></p>
<p>在使用CSS reset的时候，既可以嵌入你自己的CSS文件头部也可以从外部引入——如果你有代码洁癖：</p>
<pre name="code" class="css">
@import url(reset.css);
</pre>
<h3>不同的CSS可能破坏你的布局</h3>
<p>如果你觉得使用Universal IE6 CSS，你刚省去了很多头疼的事情。但是不要被IE7、8那个鲜亮的logo迷惑了你：如果你打算用最新的CSS技术，还要为它们做很多事情。</p>
<h4>IE6 和PNG支持</h4>
<p>大家都知道IE6不能正确显示alpha通道透明PNG图片（也就是那个好看的i.e. the good-looking ones——我又囧了），看到过精心制作的logo出现那个讨厌的淡蓝色背景。</p>
<p>你可以在一些为了是IE6显示PNG而做的变通方法中做个选择。每个方法都相当容易实施，并且在整体设计中做到不相同？（这句不知道怎么翻，大大们帮忙下——Each is fairly quick to implement and does make a difference in the overall design.）</p>
<p>这里是一些解决这个问题的优秀脚步和技术：</p>
<blockquote><ul>
<li>
<a href="http://www.dillerdesign.com/experiment/DD_belatedPNG/" target="_blank">DD_belatedPNG</a>
</li>
<li>
<a href="http://allinthehead.com/retro/338/supersleight-jquery-plugin" target="_blank">Supersleight jQuery Plugin</a>
</li>
<li>
<a href="http://www.sitepoint.com/blogs/2007/09/18/png8-the-clear-winner/" target="_blank">PNG 8-bit technique (Fireworks)</a>
</li>
<li>
<a href="http://www.smashingmagazine.com/2009/07/15/clever-png-optimization-techniques/" target="_blank">Clever PNG Optimization Techniques</a>
</li>
<li>
<a href="http://www.smashingmagazine.com/2009/07/25/png-optimization-guide-more-clever-techniques/" target="_blank">PNG Optimization Guide: More Clever Techniques</a>
</li>
</ul>
</blockquote>
<p>值得注意的是当前越来越多的网页设计选择不去为IE6解决PNG问题：</p>
<p><a href="http://www.31three.com/"><img src="http://5ivedance.com/wp-content/uploads/2010/01/06_31three.jpg" alt="" title="06_31three" width="500" height="501" class="alignnone size-full wp-image-1173" /></a></p>
<p><em>最新改版的31three没有用任何方法为IE6解决PNG问题</em></p>
<h4>高级选择符</h4>
<p>这些选择符几乎是他们自己开发的最优雅的CSS，因为他们才拥有CSS真正的力量——可以使得作为开发者的我们，人生变的更简单（我们的预算也会显著降低！）。</p>
<p>是否决定让它们在IE工作，主要取决于我们在哪里用到它们。</p>
<p>比如，如果利用它们来添加更多的细节到设计中，像代表文件类型的精致图标，如果有些浏览器不显示他们不会带来很大的区别。站点的访客不会知道他们错过了什么，链接任然完整可用。</p>
<p>这些选择符也被广泛的运用到提升排版细节，缺少对它们的支持不会给你的设计带来很大的问题。</p>
<p><a href="http://www.hicksdesign.co.uk/journal/"><img src="http://5ivedance.com/wp-content/uploads/2010/01/07hicksdesign.jpg" alt="" title="07hicksdesign" width="479" height="246" class="alignnone size-full wp-image-1174" /></a><br />
<em><br />
Hicksdesign在导航菜单的项目号码里面使用了高级选择符，对IE6用户而言它们是不可见的</em></p>
<p><strong>哪些浏览器不支持这个？</strong>实际上IE6看不到样式文件提交的任何高级选择符。它仅能理解简单的父子层级的类（classes）和ID选择符。多个类提交到同一个元素（HTML标签）甚至会冲突！不能信任IE6。</p>
<p>IE7忽略 <code>:lang</code> 选择符和伪元素（pseudo-elements），比如 <code>:first-line</code> ，<code>:first-letter</code>， <code>:before</code>，还有 <code>:after</code> 。但是可以理解所以的属性选择符。</p>
<p>另外，迄今为止发布的所有IE（作为译者的我：就是IE8和IE8-）版本都不支持伪类 <code>:target</code> ，UI元素声明伪类（<code>:enabled</code>， <code>:disabled</code>，等），结构伪类（像 <code>:nth-child</code> <code>:nth-of-type</code>还有 <code>:first-child</code>）或者负伪元素。</p>
<h4>盒模型规则</h4>
<p>盒规则允许为一个元素设置任何需要的宽和高（盒规则允许你告诉你浏览器你期望的元素宽和高）。</p>
<p>比如，可以设置 box-sizing 属性为 border-box，这时设置的宽度和高度将会减去内边距（padding）和边宽（border），而不是加上它们（上面所述是W3C的<strong>标准盒模型-standard box model</strong>说明）。</p>
<p>这样使控制元素大小变的容易，同时使得垮浏览器大小表现一致。</p>
<p>如果确信站点在IE里以缺陷的盒模型渲染（quirks mode）（以不标准的盒模型渲染-and therefore renders with the <em>non-standard</em> box model），你或许想在样式表里用这个属性使得所有的浏览器统一。</p>
<p>确保添加标准属性和浏览器专有属性：</p>
<pre name="code" class="css">
div {
	-moz-box-sizing: border-box;
	-webkit-box-sizing: border-box;
	box-sizing: border-box;
}
</pre>
<p>哪些浏览器不支持这个东东？如果站点在怪异模型（quirks mode）渲染，IE6将会用不标准的盒模型渲染，所以就算有 border-box的属性也会被渲染。可以强制IE6以怪异模型渲染（译者觉得这里应该是标准模型吧？）。有一些可选的方法，其中一个是在HTML页面doctype声明前添加HTML 注释。（译者很难过的：这一段好悲剧，没看懂或许作者没说清，这个强制的办法到底怎么做到呢。以下是英文原作Which browsers don’t support this? If the website is rendered in quirks mode, IE6 will render using the non-standard box model, so it will already be rendering as if it had the “border-box” property on. You can force IE6 to render in quirks mode. There are a few ways of doing this; one way is by adding an HTML comment before the doctype declaration of your HTML pages.）</p>
<h4>多媒体问题</h4>
<p>大多数浏览器不能完全的支持多媒体，IE根本就不支持。</p>
<p>然而，手持设备总是需要演化的样式，比如iPhone，事实上与主题毫无相干。</p>
<p>如果只是为了iPhone而是用媒体，事实上其他的浏览器不支持，任何方法都一样，鼓励更多的使用。</p>
<p>如果利用媒体建立更加灵活可用的站点，窗口大小之类的变化，现在只有Safari，Firefox和Opera支持（部分的）。</p>
<p>哪些浏览器不支持？IE，一些时候是Safari和Firefox。</p>
<h3>目录</h3>
<blockquote><ul>
<li><a href="http://5ivedance.com/development/support-internet-explorer-still-be-cutting-edge-1/">在IE主流时代诗意地编码（一）</a></li>
<li><a href="http://5ivedance.com/development/support-internet-explorer-still-be-cutting-edge-2/">在IE主流时代诗意地编码（二）</a></li>
<li><a href="http://5ivedance.com/development/support-internet-explorer-still-be-cutting-edge-3/">在IE主流时代诗意地编码（三）</a></li>
<li><a href="http://5ivedance.com/development/support-internet-explorer-still-be-cutting-edge-4/">在IE主流时代诗意地编码（四）</a></li>
<li>本文译自 Smashing Magazin [ <a href="http://www.smashingmagazine.com/2009/12/01/how-to-support-internet-explorer-and-still-be-cutting-edge/"> 英文原文</a> ]</li>
</ul>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://5ivedance.com/development/support-internet-explorer-still-be-cutting-edge-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>在IE主流时代诗意地编码（一）</title>
		<link>http://5ivedance.com/development/support-internet-explorer-still-be-cutting-edge-1/</link>
		<comments>http://5ivedance.com/development/support-internet-explorer-still-be-cutting-edge-1/#comments</comments>
		<pubDate>Sat, 09 Jan 2010 16:39:06 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[html]]></category>

		<guid isPermaLink="false">http://5ivedance.com/?p=1148</guid>
		<description><![CDATA[大家都在抱怨为什么我们不用更多的CSS3和其他一些灵活而有潜力的辅助技术，但是我们仍然需要考虑IE6和其他烦人的浏览器。
我们在实际开发过程中是怎么做的呢？在开发网站中我们怎样做到即利用最新的编码技术又可以保证Internet Explorer的用户的正常访问呢？
在这篇文章中，我们将见到既可以保证IE用户良好的用户体验又可以保证技术前进的措施。我们将集中在CSS部分，但是会提供一些处理其他问题（overall markup）的小技巧。
可以斟酌我们之前的文字：


Taming Advanced CSS Selectors
Take Your Design To The Next Level With CSS3
Push Your Web Design Into The Future With CSS3




内容最重要
杰弗里-泽尔德曼（Jeffrey Zeldman，Web 标准项目小组的负责人）曾经说，“内容要先于设计。缺少内容的设计不是设计，是装饰。” 事实上，在我们网站上最重要的是内容。无论他们使用什么样的浏览器，这才是他们需要得到的东西。
使用CSS3不是要忽略过时的浏览器，把访客拒之门外 。我们应该在老浏览器甚至是IE5、IE5.5里面测试我们的网站，保证每个用户可以看到内容。
这也不是说我们要退出消灭IE6的战争。我们仍然可以学习以下网站的例子，比如Twitter和YouTube，添加一个平易近人（dd visible but not dead-end）的升级提示。


Twitter和Youtobe的给IE6用户的提示信息
记住：每个专业人员有责任教育那些对他们专业不熟悉的人。我们应该解释这些原理给我们的客户，但不能颐指气使地说教。毕竟他们的工作不是搞清楚这些事。
首先是最基本的：“三层”分立（HTML, CSS 和 JavaScript）
当我们一步一步建立一个新站点的时候。首先，是HTML。我们将尽可能使用语义化的标签来标记我们的内容：标题应该用heading，列表用list，等等。内容完美的可读性和仅仅完成这部分代码就拥有可理解的结构是最低限度。内容应该有理有据，我们必须时刻记得这“层”（HTML）是我们开发其他剩余项目的基石。
其次，我们添加CSS样式。这一步，我们为站点添加视觉元素，使站点个性化。同时我们应该保证在没有第三层（JavaScript）的时候，内容的可读性。
最后，第三层JavaScript，行为层。这里我们给站点加入交互元素。用像tabs、sliders、lightboxes等工具丰富站点的体验。
将这些过程铭记心中，任何浏览器都可以访问我们的内容。保证过时的浏览器只得到基本的内容，而忽略那些妨碍用户浏览的复杂代码。
为老浏览器添加基本样式
这样我们语义化标记做完了。我们知道一些浏览器不能正确渲染CSS或者根本不能渲染，像那些Netscape 4.o或者Internet Explorer 4.0之前的浏览器，显示裸内容——无样式版——是最佳的选择。
一些同学认为时至今日没有必要这样做。但是如果你想确保那些使用老浏览器的同学不会陷入困境，那么用link 链接基本版本的CSS，然后用@import链接更高级CSS文件吧，如下：





	@import "advanced.css";


也可以跳过link全部标签，留给老浏览器一个只有文字的网站版本：


	@import "style.css";


拥抱差异
现在让我们来处理这个常用浏览器中的害群之马：Internet Explorer 6。
你有两个选择：
1.如果在你站点的访客中只有很少比例的人在用它（IE6），你只需要为IE6建立一个基本的样式。
2.接受你的设计在IE6中将得到不一致的表现，并且决定该舍弃什么：哪些IE6问题需要纠正那些该放弃。
如果你选择提供给IE6一个基本的样式，最好的办法是利用Universal IE6 CSS。实际上你的网站没有设计，但是这个样式表确保网页有个可读的宽度，合理的标题大小，并且内容也有一些适当的留白。
在HTML文档里，应该添加一些条件注释到样式链接上，为IE6屏蔽其他样式文件：







在第一个注释里面，为除IE66以外的浏览器引入了主要的样式文件（因为这个“!”）。在第二个注释里面我们直接从Google文件库引入Universal IE6样式表（还可以节约带宽！作为译者的我忍不住：囧一个）。


Make Photoshop Faster 这个网站就为IE6使用了Universal style sheet
如果你更看好第二路线，你必须做好面对浏览器渲染不一致的心理准备。知道在IE6、甚至IE7和IE8，一些设计的细节将看不到或者不能被完美的渲染。别因为这个悲剧感到不爽哦。
目录

在IE主流时代诗意地编码（一）
在IE主流时代诗意地编码（二）
在IE主流时代诗意地编码（三）
在IE主流时代诗意地编码（四）
本文译自 Smashing Magazin [  英文原文 ]


]]></description>
			<content:encoded><![CDATA[<p>大家都在抱怨为什么我们不用<strong>更多的CSS3</strong>和其他一些灵活而有潜力的辅助技术，但是我们仍然需要考虑IE6和其他烦人的浏览器。</p>
<p>我们在实际开发过程中是怎么做的呢？在开发网站中我们怎样做到即利用最新的编码技术又可以保证Internet Explorer的用户的正常访问呢？</p>
<p>在这篇文章中，我们将见到既可以<strong>保证IE用户良好的用户体验</strong>又可以保证技术前进的措施。我们将集中在CSS部分，但是会提供一些处理其他问题（overall markup）的小技巧。</p>
<p>可以斟酌我们之前的文字：</p>
<blockquote>
<ul>
<li><a href="http://www.smashingmagazine.com/2009/08/17/taming-advanced-css-selectors/">Taming Advanced CSS Selectors</a></li>
<li><a href="http://www.smashingmagazine.com/2009/06/15/take-your-design-to-the-next-level-with-css3/">Take Your Design To The Next Level With CSS3</a></li>
<li><a href="http://www.smashingmagazine.com/2009/01/08/push-your-web-design-into-the-future-with-css3/">Push Your Web Design Into The Future With CSS3<br />
</a></li>
</ul>
</blockquote>
<p><span id="more-1148"></span></p>
<h3>内容最重要</h3>
<p>杰弗里-泽尔德曼（Jeffrey Zeldman，Web 标准项目小组的负责人）曾经说，“内容要先于设计。缺少内容的设计不是设计，是装饰。” 事实上，在我们网站上最重要的是<strong>内容</strong>。无论他们使用什么样的浏览器，这才是他们需要得到的东西。</p>
<p>使用CSS3不是要忽略过时的浏览器，把访客拒之门外 。我们应该在老浏览器甚至是IE5、IE5.5里面测试我们的网站，保证每个用户可以看到内容。</p>
<p>这也不是说我们要退出消灭IE6的战争。我们仍然可以学习以下网站的例子，比如Twitter和YouTube，添加一个平易近人（dd visible but not dead-end）的升级提示。</p>
<p><a href="http://twitter.com/"><img class="alignnone size-full wp-image-1153" title="01twitter" src="http://5ivedance.com/wp-content/uploads/2010/01/01twitter.jpg" alt="Twitter" width="500" height="273" /></a></p>
<p><a href="http://youtube.com/"><img class="alignnone size-full wp-image-1154" title="02youtube" src="http://5ivedance.com/wp-content/uploads/2010/01/02youtube.jpg" alt="Youtube" width="500" height="93" /></a></p>
<p><em>Twitter和Youtobe的给IE6用户的提示信息</em></p>
<p>记住：每个专业人员有责任教育那些对他们专业不熟悉的人。我们应该解释这些原理给我们的客户，但不能颐指气使地说教。毕竟他们的工作不是搞清楚这些事。</p>
<h3>首先是最基本的：“三层”分立（HTML, CSS 和 JavaScript）</h3>
<p>当我们一步一步建立一个新站点的时候。首先，是<strong>HTML</strong>。我们将尽可能使用<strong>语义化</strong>的标签来标记我们的内容：标题应该用heading，列表用list，等等。内容完美的可读性和仅仅完成这部分代码就拥有可理解的结构是最低限度。内容应该有理有据，我们必须时刻记得这“层”（HTML）是我们开发其他剩余项目的<strong>基石</strong>。</p>
<p>其次，我们添加<strong>CSS样式</strong>。这一步，我们为站点添加视觉元素，使站点个性化。同时我们应该保证在没有第三层（JavaScript）的时候，内容的可读性。</p>
<p>最后，第三层JavaScript，<strong>行为</strong>层。这里我们给站点加入交互元素。用像tabs、sliders、lightboxes等工具丰富站点的体验。</p>
<p>将这些过程铭记心中，任何浏览器都可以访问我们的内容。保证过时的浏览器只得到基本的内容，而忽略那些妨碍用户浏览的复杂代码。</p>
<h3>为老浏览器添加基本样式</h3>
<p>这样我们语义化标记做完了。我们知道一些浏览器不能正确渲染CSS或者根本不能渲染，像那些Netscape 4.o或者Internet Explorer 4.0之前的浏览器，显示裸内容——无样式版——是最佳的选择。</p>
<p>一些同学认为时至今日没有必要这样做。但是如果你想确保那些使用老浏览器的同学不会陷入困境，那么用<code>link</code> 链接基本版本的CSS，然后用<code>@import</code>链接更高级CSS文件吧，如下：</p>
<pre class="html" name="code">
<link rel="stylesheet" type="text/css" href="basic.css" media="screen" />
</pre>
<pre class="html" name="code">
<style type="text/css">
	@import "advanced.css";
</style>
</pre>
<p>也可以跳过<code>link</code>全部标签，留给老浏览器一个只有文字的网站版本：</p>
<pre class="html" name="code">
<style type="text/css">
	@import "style.css";
</style>
</pre>
<h3>拥抱差异</h3>
<p>现在让我们来处理这个常用浏览器中的害群之马：Internet Explorer 6。<br />
你有两个选择：</p>
<p>1.如果在你站点的访客中只有很少比例的人在用它（IE6），你只需要为IE6建立一个基本的样式。</p>
<p>2.接受你的设计在IE6中将得到不一致的表现，并且决定该舍弃什么：哪些IE6问题需要纠正那些该放弃。</p>
<p>如果你选择提供给IE6一个基本的样式，最好的办法是利用<a href="http://code.google.com/p/universal-ie6-css/" target="_blank">Universal IE6 CSS</a>。实际上你的网站没有设计，但是这个样式表确保网页有个可读的宽度，合理的标题大小，并且内容也有一些适当的留白。</p>
<p>在HTML文档里，应该添加一些条件注释到样式链接上，为IE6屏蔽其他样式文件：</p>
<pre name="code" class="html">
<!--[if !IE 6]><!-->
<link rel="stylesheet" type="text/css" href="styles.css" media="screen" />
<!--<![endif]-->

<!--[if IE 6]>
<link rel="stylesheet" type="text/css"
	href="http://universal-ie6-css.googlecode.com/files/ie6.0.3.css" media="screen" />
<![endif]-->
</pre>
<p>在第一个注释里面，为除IE66以外的浏览器引入了主要的样式文件（因为这个“!”）。在第二个注释里面我们直接从Google文件库引入Universal IE6样式表（还可以节约带宽！作为译者的我忍不住：囧一个）。</p>
<p><a href="http://makephotoshopfaster.com/"><img src="http://5ivedance.com/wp-content/uploads/2010/01/19makepsfaster-1.jpg" alt="" title="19makepsfaster-1" width="500" height="349" class="alignnone size-full wp-image-1167" /></a><br />
<a href="http://makephotoshopfaster.com/"><img src="http://5ivedance.com/wp-content/uploads/2010/01/19makepsfaster-2.jpg" alt="" title="19makepsfaster-2" width="500" height="345" class="alignnone size-full wp-image-1168" /></a></p>
<p><em>Make Photoshop Faster 这个网站就为IE6使用了Universal style sheet</em></p>
<p>如果你更看好第二路线，你必须做好面对浏览器渲染不一致的心理准备。知道在IE6、甚至IE7和IE8，一些设计的细节将看不到或者不能被完美的渲染。<strong>别因为这个悲剧感到不爽哦</strong>。</p>
<h3>目录</h3>
<blockquote><ul>
<li><a href="http://5ivedance.com/development/support-internet-explorer-still-be-cutting-edge-1/">在IE主流时代诗意地编码（一）</a></li>
<li><a href="http://5ivedance.com/development/support-internet-explorer-still-be-cutting-edge-2/">在IE主流时代诗意地编码（二）</a></li>
<li><a href="http://5ivedance.com/development/support-internet-explorer-still-be-cutting-edge-3/">在IE主流时代诗意地编码（三）</a></li>
<li><a href="http://5ivedance.com/development/support-internet-explorer-still-be-cutting-edge-4/">在IE主流时代诗意地编码（四）</a></li>
<li>本文译自 Smashing Magazin [ <a href="http://www.smashingmagazine.com/2009/12/01/how-to-support-internet-explorer-and-still-be-cutting-edge/"> 英文原文</a> ]</li>
</ul>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://5ivedance.com/development/support-internet-explorer-still-be-cutting-edge-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Shining Ghibli</title>
		<link>http://5ivedance.com/development/shining-ghibli/</link>
		<comments>http://5ivedance.com/development/shining-ghibli/#comments</comments>
		<pubDate>Sun, 01 Mar 2009 13:35:13 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.5ivedance.com/blog/?p=524</guid>
		<description><![CDATA[
折腾了个Tab.折腾一晚上- -,又改样式玩,最后又加了Ghibli V1.0&#8230;-.,-!  以下-源：
shiningghibli.css
shiningghibli.js
ShiningGhibli -Tab(Demo)
]]></description>
			<content:encoded><![CDATA[<p><a rel="lightbox" href="http://5ivedance.com/wp-content/uploads/2009/03/shining-ghibli1.png" rel="lightbox[g524]"><img class="alignnone size-full wp-image-525" title="shining-ghibli" src="http://5ivedance.com/wp-content/uploads/2009/03/shining-ghibli.png" alt="shining-ghibli" width="500" height="319" /></a></p>
<p>折腾了个Tab.折腾一晚上- -,又改样式玩,最后又加了Ghibli V1.0&#8230;-.,-!  以下-源：</p>
<blockquote><p><a href="http://5ivedance.com/wp-content/uploads/2009/03/shiningghibli.css">shiningghibli.css</a><br />
<a href="http://5ivedance.com/wp-content/uploads/2009/03/shiningghibli.js">shiningghibli.js</a></p>
<p><a href="http://5ivedance.com/wp-content/uploads/2009/03/shiningghibli.html">ShiningGhibli -Tab(Demo)</a></p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://5ivedance.com/development/shining-ghibli/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IE6中float:right换行问题\代码公用的一点儿XX</title>
		<link>http://5ivedance.com/development/bug-of-float-right-in-ie6/</link>
		<comments>http://5ivedance.com/development/bug-of-float-right-in-ie6/#comments</comments>
		<pubDate>Mon, 16 Feb 2009 12:14:32 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[css]]></category>

		<guid isPermaLink="false">http://www.5ivedance.com/blog/?p=478</guid>
		<description><![CDATA[ demo

不知道别人是否遇到类似问题，可能这只是我自己遇到的再别人看来无足轻重的也我未必哈，不过这几天好像就这个头疼，可能我对定位的理解还是太浅薄了， 唉。例如：&#60;h1&#62;标题&#60;span&#62;更多&#60;/span&#62;&#60;/h1&#62;，其中span用float:right;右浮动，会出现换行右浮的现现象，此时在IE7,FF中给span加position:relative;top:-1em;既可以解决问题，可是IE6中开始留下的占位行会被留下来，最后自己找到的解决办法是：在h1加position:relative;再span加position:absolute;right:0;其实发现当初理解定位的时候是理解了relative是按照“自然流”为基点进行的定位，可是理解absolute一直有以为是以屏幕为基准的定位的误区。然后也解决了搜索框因为上述问题加剧的变态问题。用hacks解决了但是最后去掉了所有hacks，表单不一定都要form,说的这些都是自我感觉，可当胡说。
另外，自我感觉下一些处理较大项目代码公用的有待商榷的结论：项目较大，css再不是一个两个，可能是几十个的问题，我们现在的做法是类似全局字体，表单，链接，按钮（项目按钮多再像之前的切图或者单个编写已经不能容忍了），可以的话再加上一些清除浮动的的代码、固定字体大小的例如h2 h3小标题的字号、再就是&#8230;想起来再添加。还要一个css文件呢，放公用的代码块，比如公用的头部，底部，侧栏块代码，以及公用的出错提示，JS弹出框代码，这些部分定位尽量不要浮动不要限定固定大小，因为不同位置调用会出现不可预知的麻烦。还要的就是子板块栏目的代码，为了不会重名以及难以分辨，可能的话命名签加一个板块的字母，不过现在并没有做，命名之前用过驼峰，后来乱用，后来是下划线，比如：post_view等，但是看了不少国外的写法是post-view.又不是JS，用驼峰怪怪的- -.最近因为组内赶工，“欲速而没达”，翻工翻的厉害，好在是我翻别人的不是别人翻我的，虽然辛苦下可是还是得到了一些认可。
]]></description>
			<content:encoded><![CDATA[<blockquote><p> <a href="http://5ivedance.com/wp-content/uploads/2009/02/demo1.html">demo</a></p></blockquote>
<p><span id="more-478"></span><br />
不知道别人是否遇到类似问题，可能这只是我自己遇到的再别人看来无足轻重的也我未必哈，不过这几天好像就这个头疼，可能我对定位的理解还是太浅薄了， 唉。例如：&lt;h1&gt;标题&lt;span&gt;更多&lt;/span&gt;&lt;/h1&gt;，其中span用float:right;右浮动，会出现换行右浮的现现象，此时在IE7,FF中给span加position:relative;top:-1em;既可以解决问题，可是IE6中开始留下的占位行会被留下来，最后自己找到的解决办法是：在h1加position:relative;再span加position:absolute;right:0;其实发现当初理解定位的时候是理解了relative是按照“自然流”为基点进行的定位，可是理解absolute一直有以为是以屏幕为基准的定位的误区。然后也解决了搜索框因为上述问题加剧的变态问题。用hacks解决了但是最后去掉了所有hacks，表单不一定都要form,说的这些都是自我感觉，可当胡说。</p>
<p>另外，自我感觉下一些处理较大项目代码公用的有待商榷的结论：项目较大，css再不是一个两个，可能是几十个的问题，我们现在的做法是类似全局字体，表单，链接，按钮（项目按钮多再像之前的切图或者单个编写已经不能容忍了），可以的话再加上一些清除浮动的的代码、固定字体大小的例如h2 h3小标题的字号、再就是&#8230;想起来再添加。还要一个css文件呢，放公用的代码块，比如公用的头部，底部，侧栏块代码，以及公用的出错提示，JS弹出框代码，这些部分定位尽量不要浮动不要限定固定大小，因为不同位置调用会出现不可预知的麻烦。还要的就是子板块栏目的代码，为了不会重名以及难以分辨，可能的话命名签加一个板块的字母，不过现在并没有做，命名之前用过驼峰，后来乱用，后来是下划线，比如：post_view等，但是看了不少国外的写法是post-view.又不是JS，用驼峰怪怪的- -.最近因为组内赶工，“欲速而没达”，翻工翻的厉害，好在是我翻别人的不是别人翻我的，虽然辛苦下可是还是得到了一些认可。</p>
]]></content:encoded>
			<wfw:commentRss>http://5ivedance.com/development/bug-of-float-right-in-ie6/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>声明缩写以及淘宝面试题</title>
		<link>http://5ivedance.com/development/abbreviation-for-declaration/</link>
		<comments>http://5ivedance.com/development/abbreviation-for-declaration/#comments</comments>
		<pubDate>Sat, 11 Oct 2008 04:14:03 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[css]]></category>

		<guid isPermaLink="false">http://www.5ivedance.com/blog/?p=336</guid>
		<description><![CDATA[p { font: style variant weight size/line-height family ;}
p { font：italic small-caps bold 12px/150% verdana,arial,sans-serif ;}
background: #f3f3f3 url(lalalal.gif) right top no-repeat ;
[ LoVe HAte ]
a:link {}
a:vistited {}
a:hover {}
a:active {}
善于clear:right/left ; 返回自然元素流。
&#60;!DOCTYPE html PUBLIC &#8220;-//W3C//DTD XHTML 1.0 Transitional//EN&#8221; &#8220;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&#8221;&#62;
&#60;style type=&#8221;text/css&#8221;&#62;
&#60;!&#8211;
* {margin:0;padding:0}
div {
width:500px;
height:500px;
border:1px solid #ccc;
overflow:hidden;
position:relative;
display:table-cell;
text-align:center;
vertical-align:middle
}
div p {
position:static;
+position:absolute;
top:50%
}
img {
position:static;
+position:relative;
top:-50%;left:-50%;
width:276px;
height:110px
}
&#8211;&#62;
&#60;/style&#62;
&#60;div&#62;&#60;p&#62;&#60;img src=&#8221;http://www.google.com/intl/en/images/logo.gif&#8221; /&#62;&#60;/p&#62;&#60;/div&#62;
]]></description>
			<content:encoded><![CDATA[<p>p { font: style variant weight <strong>size/line-heigh</strong>t family ;}</p>
<p>p { font：italic small-caps bold 12px/150% verdana,arial,sans-serif ;}</p>
<p>background: #f3f3f3 url(lalalal.gif) right top no-repeat ;</p>
<p>[ <strong>L</strong>o<strong>V</strong>e <strong>HA</strong>te ]</p>
<p>a:link {}</p>
<p>a:vistited {}</p>
<p>a:hover {}</p>
<p>a:active {}</p>
<p>善于clear:right/left ; 返回自然元素流。</p>
<blockquote><p>&lt;!DOCTYPE html PUBLIC &#8220;-//W3C//DTD XHTML 1.0 Transitional//EN&#8221; &#8220;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&#8221;&gt;<br />
&lt;style type=&#8221;text/css&#8221;&gt;<br />
&lt;!&#8211;<br />
* {margin:0;padding:0}<br />
div {<br />
width:500px;<br />
height:500px;<br />
border:1px solid #ccc;<br />
overflow:hidden;<br />
position:relative;<br />
display:table-cell;<br />
text-align:center;<br />
vertical-align:middle<br />
}<br />
div p {<br />
position:static;<br />
+position:absolute;<br />
top:50%<br />
}<br />
img {<br />
position:static;<br />
+position:relative;<br />
top:-50%;left:-50%;<br />
width:276px;<br />
height:110px<br />
}<br />
&#8211;&gt;<br />
&lt;/style&gt;<br />
&lt;div&gt;&lt;p&gt;&lt;img src=&#8221;http://www.google.com/intl/en/images/logo.gif&#8221; /&gt;&lt;/p&gt;&lt;/div&gt;</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://5ivedance.com/development/abbreviation-for-declaration/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Entomology（居中）</title>
		<link>http://5ivedance.com/development/entomology-align-center/</link>
		<comments>http://5ivedance.com/development/entomology-align-center/#comments</comments>
		<pubDate>Thu, 25 Sep 2008 01:48:20 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[hack]]></category>

		<guid isPermaLink="false">http://www.5ivedance.com/blog/?p=314</guid>
		<description><![CDATA[组合使用自动外边距和文本对齐
这始终是个hack（为兼容地域IE6的浏览器），无论如何也算不上完美。
body {
text-align: center;
}
#container {
margin-left: auto;
margin-right: auto;
width:200px;
text-align:left;
}
负外边距解决方案
Entomology用到的代码：
#container｛
background: #ffc;
position: absolute;
left: 50%;
width: 760px;
margin-left: -380px;
}
没任何hack!适用性极广——Netscape 4.x中都没问题，不是首选，但是想得到广泛浏览器支持，这是最好的选择。
]]></description>
			<content:encoded><![CDATA[<p><strong>组合使用自动外边距和文本对齐</strong></p>
<p>这始终是个hack（为兼容地域IE6的浏览器），无论如何也算不上完美。</p>
<blockquote><p>body {</p>
<p><strong><span style="color: #993300;">text-align: center;</span></strong></p>
<p>}</p>
<p>#container {</p>
<p>margin-left: auto;</p>
<p>margin-right: auto;</p>
<p>width:200px;</p>
<p>text-align:left;</p>
<p>}</p></blockquote>
<p><strong>负外边距解决方案</strong></p>
<p>Entomology用到的代码：</p>
<blockquote><p>#container｛</p>
<p>background: #ffc;</p>
<p><strong><span style="color: #993300;">position: absolute;</span></strong></p>
<p><strong><span style="color: #993300;">left: 50%;</span></strong></p>
<p>width: 760px;</p>
<p><strong><span style="color: #993300;">margin-left: -380px;</span></strong></p>
<p>}</p></blockquote>
<p>没任何hack!适用性极广——Netscape 4.x中都没问题，不是首选，但是想得到广泛浏览器支持，这是最好的选择。</p>
]]></content:encoded>
			<wfw:commentRss>http://5ivedance.com/development/entomology-align-center/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using disk (enhanced) (user agent is rejected)

Served from: 5ivedance.com @ 2010-08-01 03:30:38 -->