<?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>WEB前端开发</title>
	<atom:link href="http://www.caihong.cc/index.php?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://www.caihong.cc</link>
	<description>闪亮于WEB前端的彩虹</description>
	<lastBuildDate>Mon, 26 Mar 2012 09:53:01 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>IE下如果包含锚点并且包含Flash元素title会被追加锚点的问题</title>
		<link>http://www.caihong.cc/?p=217</link>
		<comments>http://www.caihong.cc/?p=217#comments</comments>
		<pubDate>Mon, 26 Mar 2012 09:53:01 +0000</pubDate>
		<dc:creator>练习</dc:creator>
				<category><![CDATA[行为]]></category>

		<guid isPermaLink="false">http://www.caihong.cc/?p=217</guid>
		<description><![CDATA[在IE下，如果页面的URL包含锚点（#abc），并且页面包含Flash元素（现在大多数页面都会有）。 当Flash加载的时候，会把页面的title（document.title）给改变，变成 “原title#锚点”。如果有多个Flash就会变成“原title#锚点#锚点#锚点#锚点”。 找了半天解决办法，需要在每次Flash加载后都重设title，这个肯定不行，页面那么多元素，不能挨个控制。 同事提供了解决方法： var originalTitle = document.title.split(&#34;#&#34;)[0];&#160; &#160; document.attachEvent('onpropertychange', function (evt) { &#160;&#160; &#160;evt = evt &#124;&#124; window.event; &#160;&#160; &#160;if(evt.propertyName === 'title' &#38;&#38; document.title !== originalTitle) { &#160;&#160; &#160; &#160; &#160;setTimeout(function () { &#160;&#160; &#160; &#160; &#160; &#160; document.title = originalTitle; &#160;&#160; &#160; &#160; &#160;}, 1); &#160;&#160; &#160;} }) 但是这样有个问题，就是以后修改不了页面title了，因为每次修改都会被重置。 function changeTitle(newTitle) &#160;&#160; [...]]]></description>
			<content:encoded><![CDATA[<p>在IE下，如果页面的URL包含锚点（#abc），并且页面包含Flash元素（现在大多数页面都会有）。</p>
<p>当Flash加载的时候，会把页面的title（document.title）给改变，变成 “原title#锚点”。如果有多个Flash就会变成“原title#锚点#锚点#锚点#锚点”。</p>
<p>找了半天解决办法，需要在每次Flash加载后都重设title，这个肯定不行，页面那么多元素，不能挨个控制。<span id="more-217"></span></p>
<p>同事提供了解决方法：</p>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline">var originalTitle = document.title.split(&quot;#&quot;)[0];&nbsp; &nbsp; </li>
<li>document.attachEvent('onpropertychange', function (evt) {</li>
<li>&nbsp;&nbsp; &nbsp;evt = evt || window.event;</li>
<li>&nbsp;&nbsp; &nbsp;if(evt.propertyName === 'title' &amp;&amp; document.title !== originalTitle) {</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;setTimeout(function () {</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; document.title = originalTitle;</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;}, 1);</li>
<li>&nbsp;&nbsp; &nbsp;}</li>
<li>})</li></ol></div>
<p>但是这样有个问题，就是以后修改不了页面title了，因为每次修改都会被重置。</p>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline">function changeTitle(newTitle)</li>
<li>&nbsp;&nbsp; &nbsp;{</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;originalTitle = newTitle;</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;document.title = newtitle;</li>
<li>&nbsp;&nbsp; &nbsp;}</li></ol></div>
]]></content:encoded>
			<wfw:commentRss>http://www.caihong.cc/?feed=rss2&#038;p=217</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>当inline-block和text-indent遇到IE6,IE7</title>
		<link>http://www.caihong.cc/?p=214</link>
		<comments>http://www.caihong.cc/?p=214#comments</comments>
		<pubDate>Wed, 21 Mar 2012 03:59:21 +0000</pubDate>
		<dc:creator>练习</dc:creator>
				<category><![CDATA[其他]]></category>

		<guid isPermaLink="false">http://www.caihong.cc/?p=214</guid>
		<description><![CDATA[在实际应用中，考虑到seo，很多button，icon都要用到inline-block和text-indent来处理，例如： &#60;a href=&#34;#&#34; class=&#34;btn&#34;&#62;Button&#60;/a&#62; css我习惯写成这样 .btn{display:inline-block; width:100px; height:23px; text-indent:-9999px;background-image:url(img.jpg);} 在标准浏览器下是没问题的，但是在IE6和7下会触发A标签消失的bug。 解决方法1： display:inline-block; 改为 display:block; 然后再做布局处理。 解决方法2： text-indent:-9999px; 改为 font-size:0; line-height:0; 或者各种可以隐藏掉内容元素的方法。 解决方法3： &#38;nbsp;&#60;a href=&#34;#&#34; class=&#34;btn&#34;&#62;Button&#60;/a&#62; 在按钮前面增加任何元素，都可以让消失的按钮重新出现。 解决方法4： 给元素加 position:absolute; PS：inline或inline-block元素设置text-indent在IE6/IE7中显示不正常的bug致使text-indent会传递到父及元素，也就出现了上文中的结果。 造成这种情况的原因应该是IE6/IE7并没有真正实现inline-block,而是通过设置display:inline-block触发了IE的layout,从而使内联元素拥有了inline-block属性的表症。 考察元素的默认样式，可知：input、select、button、textarea的默认display皆为inline-block,所以在布局时应加以注意&#8230;]]></description>
			<content:encoded><![CDATA[<p>在实际应用中，考虑到seo，很多button，icon都要用到inline-block和text-indent来处理，例如：</p>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline">&lt;a href=&quot;#&quot; class=&quot;btn&quot;&gt;Button&lt;/a&gt;</li></ol></div>
<p>css我习惯写成这样</p>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline">.btn{display:inline-block; width:100px; height:23px; text-indent:-9999px;background-image:url(img.jpg);}</li></ol></div>
<p>在标准浏览器下是没问题的，但是在IE6和7下会触发A标签消失的bug。<span id="more-214"></span></p>
<p><strong>解决方法1：</strong></p>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline">display:inline-block;</li></ol></div>
<p>改为</p>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline">display:block;</li></ol></div>
<p>然后再做布局处理。</p>
<p><strong>解决方法2：</strong></p>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline">text-indent:-9999px;</li></ol></div>
<p>改为</p>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline">font-size:0; line-height:0;</li></ol></div>
<p>或者各种可以隐藏掉内容元素的方法。</p>
<p><strong>解决方法3：</strong></p>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline">&amp;nbsp;&lt;a href=&quot;#&quot; class=&quot;btn&quot;&gt;Button&lt;/a&gt;</li></ol></div>
<p>在按钮前面增加任何元素，都可以让消失的按钮重新出现。</p>
<p><strong>解决方法4：</strong><br />
给元素加 position:absolute;</p>
<p>PS：inline或inline-block元素设置text-indent在IE6/IE7中显示不正常的bug致使text-indent会传递到父及元素，也就出现了上文中的结果。</p>
<p>造成这种情况的原因应该是IE6/IE7并没有真正实现inline-block,而是通过设置display:inline-block触发了IE的layout,从而使内联元素拥有了inline-block属性的表症。</p>
<p>考察元素的默认样式，可知：input、select、button、textarea的默认display皆为inline-block,所以在布局时应加以注意&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.caihong.cc/?feed=rss2&#038;p=214</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>A Simple Scene Animated with CSS3</title>
		<link>http://www.caihong.cc/?p=205</link>
		<comments>http://www.caihong.cc/?p=205#comments</comments>
		<pubDate>Fri, 09 Dec 2011 03:15:23 +0000</pubDate>
		<dc:creator>练习</dc:creator>
				<category><![CDATA[结构]]></category>
		<category><![CDATA[行为]]></category>
		<category><![CDATA[表现]]></category>

		<guid isPermaLink="false">http://www.caihong.cc/?p=205</guid>
		<description><![CDATA[A Simple Scene Animated with CSS3 (requires Chrome, Safari, Firefox 5+, or IE10 PP3) Use the button above to start and reset the animation. Use the tabs at top right to view the code for each element of the animation. No images, no JavaScript. The only JavaScript on this page is for the button that [...]]]></description>
			<content:encoded><![CDATA[<p>A Simple Scene Animated with CSS3 (requires Chrome, Safari, Firefox 5+, or IE10 PP3)</p>
<p>
Use the button above to start and reset the animation.<br />
Use the tabs at top right to view the code for each element of the animation. No images, no JavaScript. The only JavaScript on this page is for the button that starts and resets the animation, and for the tabs.<br />
This demo was created for this article on Smashing Magazine.
</p>
<p><span id="more-205"></span></p>
<div class="runcode">
<p><textarea name="runcode" class="runcode_text" 

id="runcode_7qkEes">
&lt;!DOCTYPE html&gt;
&lt;html lang=&quot;en&quot;&gt;
&lt;head&gt;
&lt;meta charset=&quot;utf-8&quot;&gt;
&lt;title&gt;CSS3 Keyframe Animation Demo&lt;/title&gt;
&lt;style&gt;
html,body,div,span,
applet,object,iframe,
h1,h2,h3,h4,h5,h6,p,blockquote,pre,
a,abbr,acronym,address,big,cite,code,
del,dfn,font,img,ins,kbd,q,s,samp,
small,strike,sub,sup,tt,var,
dd,dl,dt,li,ol,ul,
fieldset,form,label,legend,
table,caption,tbody,tfoot,thead,tr,th,td {
	margin: 0;
	padding: 0;
	border: 0;
	font-weight: normal;
	font-style: normal;
	font-size: 100%;
	font-family: inherit;
	text-align: left;
}
table {
	border-collapse: collapse;
	border-spacing: 0;
}
ol,ul {
	list-style: none;
}
q:before,q:after,
blockquote:before,blockquote:after {
	content: &quot;&quot;;
}
#container {
	width: 1080px;
	margin: 0 auto;
	overflow: hidden;
	padding: 50px 20px 0 20px;
}
	h1 {
		font-size: 30px;
		padding: 0 0 20px 0;
	}
	h1 span {
		font-size: 18px;
	}
	#left {
		overflow: hidden;
		float: left;
	}
		#left p {
			width: 470px;
			padding: 20px 0 0 0;
			font-family: Arial, Helvetica, sans-serif;
		}
#sky {
	width: 500px;
	height: 500px;
	position: relative;
	z-index: 1;
	overflow: hidden;
	background-color: #525252;
}
#sky.animate {
	-webkit-animation-name: sky;
	-webkit-animation-duration: 10s;
	-webkit-animation-timing-function: ease;
	-webkit-animation-iteration-count: 1;
	-webkit-animation-direction: normal;
	-webkit-animation-delay: 0;
	-webkit-animation-play-state: running;
	-webkit-animation-fill-mode: forwards;
	-moz-animation-name: sky;
	-moz-animation-duration: 10s;
	-moz-animation-timing-function: ease;
	-moz-animation-iteration-count: 1;
	-moz-animation-direction: normal;
	-moz-animation-delay: 0;
	-moz-animation-play-state: running;
	-moz-animation-fill-mode: forwards;
	-ms-animation-name: sky;
	-ms-animation-duration: 10s;
	-ms-animation-timing-function: ease;
	-ms-animation-iteration-count: 1;
	-ms-animation-direction: normal;
	-ms-animation-delay: 0;
	-ms-animation-play-state: running;
	-ms-animation-fill-mode: forwards;
	animation-name: sky;
	animation-duration: 10s;
	animation-timing-function: ease;
	animation-iteration-count: 1;
	animation-direction: normal;
	animation-delay: 0;
	animation-play-state: running;
	animation-fill-mode: forwards;
}
@-webkit-keyframes sky {
	0% {
		background-color: #525252;
	}
	33% {
		background-color: #6293e5;
	}
	66% {
		background-color: #6293e5;
	}
	100% {
		background-color: #525252;
	}
}
@-moz-keyframes sky {
	0% {
		background-color: #525252;
	}
	33% {
		background-color: #6293e5;
	}
	66% {
		background-color: #6293e5;
	}
	100% {
		background-color: #525252;
	}
}
@-ms-keyframes sky {
	0% {
		background-color: #525252;
	}
	33% {
		background-color: #6293e5;
	}
	66% {
		background-color: #6293e5;
	}
	100% {
		background-color: #525252;
	}
}
@keyframes sky {
	0% {
		background-color: #525252;
	}
	33% {
		background-color: #6293e5;
	}
	66% {
		background-color: #6293e5;
	}
	100% {
		background-color: #525252;
	}
}
#ground {
	position: absolute;
	bottom: 0;
	left: 0;
	width: 500px;
	height: 154px;
	background: #6c5228;
	z-index: 4;
}
#ground.animate {
	-webkit-animation-name: ground;
	-webkit-animation-duration: 10s;
	-webkit-animation-timing-function: ease;
	-webkit-animation-iteration-count: 1;
	-webkit-animation-direction: normal;
	-webkit-animation-delay: 0;
	-webkit-animation-play-state: running;
	-webkit-animation-fill-mode: forwards;
	-moz-animation-name: ground;
	-moz-animation-duration: 10s;
	-moz-animation-timing-function: ease;
	-moz-animation-iteration-count: 1;
	-moz-animation-direction: normal;
	-moz-animation-delay: 0;
	-moz-animation-play-state: running;
	-moz-animation-fill-mode: forwards;
	-ms-animation-name: ground;
	-ms-animation-duration: 10s;
	-ms-animation-timing-function: ease;
	-ms-animation-iteration-count: 1;
	-ms-animation-direction: normal;
	-ms-animation-delay: 0;
	-ms-animation-play-state: running;
	-ms-animation-fill-mode: forwards;
	animation-name: ground;
	animation-duration: 10s;
	animation-timing-function: ease;
	animation-iteration-count: 1;
	animation-direction: normal;
	animation-delay: 0;
	animation-play-state: running;
	animation-fill-mode: forwards;
}
@-webkit-keyframes ground {
	0% {
		background: #6c5228;
	}
	33% {
		background: #48a037;
	}
	66% {
		background: #48a037;
	}
	100% {
		background: #6c5228;
	}
}
@-moz-keyframes ground {
	0% {
		background: #6c5228;
	}
	33% {
		background: #48a037;
	}
	66% {
		background: #48a037;
	}
	100% {
		background: #6c5228;
	}
}
@-ms-keyframes ground {
	0% {
		background: #6c5228;
	}
	33% {
		background: #48a037;
	}
	66% {
		background: #48a037;
	}
	100% {
		background: #6c5228;
	}
}
@keyframes ground {
	0% {
		background: #6c5228;
	}
	33% {
		background: #48a037;
	}
	66% {
		background: #48a037;
	}
	100% {
		background: #6c5228;
	}
}
#sun {
	background: #ffd630;
	width: 130px;
	height: 130px;
	position: absolute;
	border-radius: 70px;
	z-index: 2;
	bottom: 0;
	left: 340px;
}
#sun.animate {
	-webkit-animation-name: sunrise;
	-webkit-animation-duration: 10s;
	-webkit-animation-timing-function: ease;
	-webkit-animation-iteration-count: 1;
	-webkit-animation-direction: normal;
	-webkit-animation-delay: 0;
	-webkit-animation-play-state: running;
	-webkit-animation-fill-mode: forwards;
	-moz-animation-name: sunrise;
	-moz-animation-duration: 10s;
	-moz-animation-timing-function: ease;
	-moz-animation-iteration-count: 1;
	-moz-animation-direction: normal;
	-moz-animation-delay: 0;
	-moz-animation-play-state: running;
	-moz-animation-fill-mode: forwards;
	-ms-animation-name: sunrise;
	-ms-animation-duration: 10s;
	-ms-animation-timing-function: ease;
	-ms-animation-iteration-count: 1;
	-ms-animation-direction: normal;
	-ms-animation-delay: 0;
	-ms-animation-play-state: running;
	-ms-animation-fill-mode: forwards;
	animation-name: sunrise;
	animation-duration: 10s;
	animation-timing-function: ease;
	animation-iteration-count: 1;
	animation-direction: normal;
	animation-delay: 0;
	animation-play-state: running;
	animation-fill-mode: forwards;
}
@-webkit-keyframes sunrise {
	0% {
		bottom: 0;
		left: 340px;
		background: #f00;
	}
	33% {
		bottom: 340px;
		left: 340px;
		background: #ffd630;
	}
	66% {
		bottom: 340px;
		left: 40px;
		background: #ffd630;
	}
	100% {
		bottom: 0;
		left: 40px;
		background: #f00;
	}
}
@-moz-keyframes sunrise {
	0% {
		bottom: 0;
		left: 340px;
		background: #f00;
	}
	33% {
		bottom: 340px;
		left: 340px;
		background: #ffd630;
	}
	66% {
		bottom: 340px;
		left: 40px;
		background: #ffd630;
	}
	100% {
		bottom: 0;
		left: 40px;
		background: #f00;
	}
}
@-ms-keyframes sunrise {
	0% {
		bottom: 0;
		left: 340px;
		background: #f00;
	}
	33% {
		bottom: 340px;
		left: 340px;
		background: #ffd630;
	}
	66% {
		bottom: 340px;
		left: 40px;
		background: #ffd630;
	}
	100% {
		bottom: 0;
		left: 40px;
		background: #f00;
	}
}
@keyframes sunrise {
	0% {
		bottom: 0;
		left: 340px;
		background: #f00;
	}
	33% {
		bottom: 340px;
		left: 340px;
		background: #ffd630;
	}
	66% {
		bottom: 340px;
		left: 40px;
		background: #ffd630;
	}
	100% {
		bottom: 0;
		left: 40px;
		background: #f00;
	}
}
#cloud {
	position: relative;
	top: 50px;
	left: -100px;
	opacity: 0;
	z-index: 3;
}
#cloud.animate {
	-webkit-animation-name: cloud;
	-webkit-animation-duration: 12s;
	-webkit-animation-timing-function: ease;
	-webkit-animation-iteration-count: 1;
	-webkit-animation-direction: normal;
	-webkit-animation-delay: 0;
	-webkit-animation-play-state: running;
	-webkit-animation-fill-mode: forwards;
	-moz-animation-name: cloud;
	-moz-animation-duration: 12s;
	-moz-animation-timing-function: ease;
	-moz-animation-iteration-count: 1;
	-moz-animation-direction: normal;
	-moz-animation-delay: 0;
	-moz-animation-play-state: running;
	-moz-animation-fill-mode: forwards;
	-ms-animation-name: cloud;
	-ms-animation-duration: 12s;
	-ms-animation-timing-function: ease;
	-ms-animation-iteration-count: 1;
	-ms-animation-direction: normal;
	-ms-animation-delay: 0;
	-ms-animation-play-state: running;
	-ms-animation-fill-mode: forwards;
	animation-name: cloud;
	animation-duration: 12s;
	animation-timing-function: ease;
	animation-iteration-count: 1;
	animation-direction: normal;
	animation-delay: 0;
	animation-play-state: running;
	animation-fill-mode: forwards;
}
@-webkit-keyframes cloud {
	0% {
		opacity: 0;
		left: -100px;
	}
	50% {
		opacity: 1;
		left: 60px;
	}
	75% {
		opacity: 1;
		left: 100px;
	}
	100% {
		opacity: 0;
		left: 500px;
	}
}
@-moz-keyframes cloud {
	0% {
		opacity: 0;
		left: -100px;
	}
	50% {
		opacity: 1;
		left: 60px;
	}
	75% {
		opacity: 1;
		left: 100px;
	}
	100% {
		opacity: 0;
		left: 500px;
	}
}
@-ms-keyframes cloud {
	0% {
		opacity: 0;
		left: -100px;
	}
	50% {
		opacity: 1;
		left: 60px;
	}
	75% {
		opacity: 1;
		left: 100px;
	}
	100% {
		opacity: 0;
		left: 500px;
	}
}
@keyframes cloud {
	0% {
		opacity: 0;
		left: -100px;
	}
	50% {
		opacity: 1;
		left: 60px;
	}
	75% {
		opacity: 1;
		left: 100px;
	}
	100% {
		opacity: 0;
		left: 500px;
	}
}
.cloud {
	border-radius: 90px / 30px;
	width: 160px;
	height: 50px;
	background: #fff;
	position: absolute;
	top: 10px;
}
.cloud-2 {
	left: 50px;
	top: 0;
}
.cloud-3 {
	left: 110px;
	top: 20px;
}
#moon {
	position: relative;
	opacity: 0;
	top: 50px;
	left: -100px;
}
#moon.animate {
	-webkit-animation-name: moon;
	-webkit-animation-duration: 10s;
	-webkit-animation-timing-function: ease;
	-webkit-animation-iteration-count: 1;
	-webkit-animation-direction: normal;
	-webkit-animation-delay: 0;
	-webkit-animation-play-state: running;
	-webkit-animation-fill-mode: forwards;
	-moz-animation-name: moon;
	-moz-animation-duration: 10s;
	-moz-animation-timing-function: ease;
	-moz-animation-iteration-count: 1;
	-moz-animation-direction: normal;
	-moz-animation-delay: 0;
	-moz-animation-play-state: running;
	-moz-animation-fill-mode: forwards;
	-ms-animation-name: moon;
	-ms-animation-duration: 10s;
	-ms-animation-timing-function: ease;
	-ms-animation-iteration-count: 1;
	-ms-animation-direction: normal;
	-ms-animation-delay: 0;
	-ms-animation-play-state: running;
	-ms-animation-fill-mode: forwards;
	animation-name: moon;
	animation-duration: 10s;
	animation-timing-function: ease;
	animation-iteration-count: 1;
	animation-direction: normal;
	animation-delay: 0;
	animation-play-state: running;
	animation-fill-mode: forwards;
}
@-webkit-keyframes moon {
	0% {
		opacity: 0;
		left: -100px;
	}
	50% {
		opacity: 0;
		left: -100px;
	}
	90% {
		opacity: 0;
		left: -100px;
	}
	100% {
		opacity: 1;
		left: 50px;
	}
}
@-moz-keyframes moon {
	0% {
		opacity: 0;
		left: -100px;
	}
	50% {
		opacity: 0;
		left: -100px;
	}
	90% {
		opacity: 0;
		left: -100px;
	}
	100% {
		opacity: 1;
		left: 50px;
	}
}
@-ms-keyframes moon {
	0% {
		opacity: 0;
		left: -100px;
	}
	50% {
		opacity: 0;
		left: -100px;
	}
	90% {
		opacity: 0;
		left: -100px;
	}
	100% {
		opacity: 1;
		left: 50px;
	}
}
@keyframes moon {
	0% {
		opacity: 0;
		left: -100px;
	}
	50% {
		opacity: 0;
		left: -100px;
	}
	90% {
		opacity: 0;
		left: -100px;
	}
	100% {
		opacity: 1;
		left: 50px;
	}
}
	.moon {
		width: 100px;
		height: 100px;
		border-radius: 50px;
		background: #fff;
		position: absolute;
	}
	.moon-2 {
		background: #525252;
		position: absolute;
		top: -20px;
		left: 20px;
	}
#code {
	float: left;
	margin: 0 0 0 20px;
	width: 494px;
}
ul.headers {
	overflow: hidden;
}
	ul.headers li {
		float: left;
		width: 85px;
		border: dashed 1px #ccc;
		margin: 0 4px;
	}
	ul.headers li a {
		display: block;
		text-decoration: none;
		font-family: Arial, Helvetica, sans-serif;
		font-size: 14px;
		text-align: center;
		padding: 10px;
	}
	ul.headers li a:hover, ul.headers li a:active {
		background: #ccc;
		color: #fff;
	}
#tab_content {
	border: #ccc 1px dashed;
	margin: 20px 0 20px 3px;
	padding: 0 0 20px 10px;
	width: 456px;
}
div.tab {
	font-family: Arial, Helvetica, sans-serif;
	margin: 30px 0 0 10px;
}
div.tab pre {
	font-family: &quot;Courier New&quot;, Courier, monospace;
	font-size: 13px;
}
input[type=&quot;button&quot;] {
	margin: 20px 0 0 165px;
	padding: 5px;
}
&lt;/style&gt;
&lt;/head&gt;
&lt;body style=&quot;width: 98%;&quot;&gt;
&lt;div id=&quot;container&quot;&gt;
	&lt;h1&gt;A Simple Scene Animated with CSS3 &lt;span&gt;(requires Chrome, Safari, Firefox 5+, or IE10 PP3)&lt;/span&gt;&lt;/h1&gt;
	&lt;div id=&quot;left&quot;&gt;
		&lt;div id=&quot;sky&quot; class=&quot;target&quot;&gt;
			&lt;div id=&quot;cloud&quot; class=&quot;target&quot;&gt;
				&lt;div class=&quot;cloud cloud-1&quot;&gt;&lt;/div&gt;
				&lt;div class=&quot;cloud cloud-2&quot;&gt;&lt;/div&gt;
				&lt;div class=&quot;cloud cloud-3&quot;&gt;&lt;/div&gt;
			&lt;/div&gt;
			&lt;div id=&quot;sun&quot; class=&quot;target&quot;&gt;&lt;/div&gt;
			&lt;div id=&quot;moon&quot; class=&quot;target&quot;&gt;
				&lt;div class=&quot;moon&quot;&gt;
				&lt;/div&gt;
				&lt;div class=&quot;moon moon-2&quot;&gt;
				&lt;/div&gt;
			&lt;/div&gt;
			&lt;div id=&quot;ground&quot; class=&quot;target&quot;&gt;&lt;/div&gt;
		&lt;/div&gt;&lt;!-- #sky --&gt;
		&lt;input type=&quot;button&quot; value=&quot;ANIMATE THE SCENE&quot; id=&quot;startbutton&quot;&gt;
		&lt;p&gt;&lt;strong&gt;Use the button above to start and reset the animation.&lt;/strong&gt;&lt;/p&gt;
		&lt;p&gt;Use the tabs at top right to view the code for each element of the animation. No images, no JavaScript. The only JavaScript on this page is for the button that starts and resets the animation, and for the tabs.&lt;/p&gt;
		&lt;p&gt;This demo was created for &lt;a href=&quot;http://www.smashingmagazine.com/2011/05/17/an-introduction-to-css3-keyframe-animations/&quot;&gt;this article&lt;/a&gt; on Smashing Magazine.&lt;/p&gt;
	&lt;/div&gt;&lt;!-- #left --&gt;
	&lt;div id=&quot;code&quot;&gt;
		&lt;div id=&quot;sidebar_tabs&quot;&gt;
			&lt;ul class=&quot;headers&quot;&gt;
				&lt;li&gt;&lt;a href=&quot;#&quot; class=&quot;tablink&quot;&gt;Sun&lt;/a&gt;&lt;/li&gt;
				&lt;li&gt;&lt;a href=&quot;#&quot; class=&quot;tablink&quot;&gt;Sky&lt;/a&gt;&lt;/li&gt;
				&lt;li&gt;&lt;a href=&quot;#&quot; class=&quot;tablink&quot;&gt;Ground&lt;/a&gt;&lt;/li&gt;
				&lt;li&gt;&lt;a href=&quot;#&quot; class=&quot;tablink&quot;&gt;Cloud&lt;/a&gt;&lt;/li&gt;
				&lt;li&gt;&lt;a href=&quot;#&quot; class=&quot;tablink&quot;&gt;Moon&lt;/a&gt;&lt;/li&gt;
			&lt;/ul&gt;
			&lt;div id=&quot;tab_content&quot;&gt;
				&lt;div class=&quot;tab tab1&quot;&gt;
&lt;pre&gt;
#sun.animate {
	animation-name: sunrise;
	animation-duration: 10s;
	animation-timing-function: ease;
	animation-iteration-count: 1;
	animation-direction: normal;
	animation-delay: 0;
	animation-play-state: running;
	animation-fill-mode: forwards;
}
@keyframes sunrise {
	0% {
		bottom: 0;
		left: 340px;
		background: #f00;
	}
	33% {
		bottom: 340px;
		left: 340px;
		background: #ffd630;
	}
	66% {
		bottom: 340px;
		left: 40px;
		background: #ffd630;
	}
	100% {
		bottom: 0;
		left: 40px;
		background: #f00;
	}
}
&lt;/pre&gt;
				&lt;/div&gt;
				&lt;div class=&quot;tab tab2&quot;&gt;
&lt;pre&gt;
#sky.animate {
	animation-name: sky;
	animation-duration: 10s;
	animation-timing-function: ease;
	animation-iteration-count: 1;
	animation-direction: normal;
	animation-delay: 0;
	animation-play-state: running;
	animation-fill-mode: forwards;
}
@keyframes sky {
	0% {
		background-color: #525252;
	}
	33% {
		background-color: #6293e5;
	}
	66% {
		background-color: #6293e5;
	}
	100% {
		background-color: #525252;
	}
}
&lt;/pre&gt;
				&lt;/div&gt;
				&lt;div class=&quot;tab tab3&quot;&gt;
&lt;pre&gt;
#ground.animate {
	animation-name: ground;
	animation-duration: 10s;
	animation-timing-function: ease;
	animation-iteration-count: 1;
	animation-direction: normal;
	animation-delay: 0;
	animation-play-state: running;
	animation-fill-mode: forwards;
}
@keyframes ground {
	0% {
		background: #6c5228;
	}
	33% {
		background: #48a037;
	}
	66% {
		background: #48a037;
	}
	100% {
		background: #6c5228;
	}
}
&lt;/pre&gt;
				&lt;/div&gt;
				&lt;div class=&quot;tab tab4&quot;&gt;
&lt;pre&gt;
#cloud.animate {
	animation-name: cloud;
	animation-duration: 12s;
	animation-timing-function: ease;
	animation-iteration-count: 1;
	animation-direction: normal;
	animation-delay: 0;
	animation-play-state: running;
	animation-fill-mode: forwards;
}
@keyframes cloud {
	0% {
		opacity: 0;
		left: -100px;
	}
	50% {
		opacity: 1;
	}
	75% {
		opacity: 1;
		left: 100px;
	}
	100% {
		opacity: 0;
		left: 500px;
	}
}
&lt;/pre&gt;
				&lt;/div&gt;
				&lt;div class=&quot;tab tab5&quot;&gt;
&lt;pre&gt;
#moon.animate {
	animation-name: moon;
	animation-duration: 10s;
	animation-timing-function: ease;
	animation-iteration-count: 1;
	animation-direction: normal;
	animation-delay: 0;
	animation-play-state: running;
	animation-fill-mode: forwards;
}
@keyframes moon {
	0% {
		opacity: 0;
		left: -100px;
	}
	50% {
		opacity: 0;
		left: -100px;
	}
	90% {
		opacity: 0;
		left: -100px;
	}
	100% {
		opacity: 1;
		left: 50px;
	}
}&lt;/pre&gt;
				&lt;/div&gt;
			&lt;/div&gt;&lt;!-- #tab_content --&gt;
		&lt;/div&gt;&lt;!-- #sidebar_tabs --&gt;
	&lt;/div&gt;&lt;!-- #code --&gt;
&lt;/div&gt;
&lt;script src=&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js&quot;&gt;&lt;/script&gt;
&lt;script&gt;
$(function () {
	var s = null,
	AnimationSpace = {
		settings: {
			tabHeaders: null,
			tabSections: null,
			currentIndex: null,
			speed: 800,
			collection: null,
			i: null,
			j: null,
			startButton: $(&quot;#startbutton&quot;)
		},
		init: function () {
			s = this.settings;
			s.tabSections = $(&quot;div.tab&quot;);
			$(s.tabSections[0]).slideDown(s.speed);
			$(s.tabSections[1]).slideUp(s.speed);
			$(s.tabSections[2]).slideUp(s.speed);
			$(s.tabSections[3]).slideUp(s.speed);
			$(s.tabSections[4]).slideUp(s.speed);
			this.getClickedTab();
			this.startAnimation();
		},
		getClickedTab: function () {
			s = this.settings;
			s.tabHeaders = $(&quot;#sidebar_tabs ul.headers a&quot;);
			s.collection = $(&quot;#tab_content div.tab&quot;);
			$(s.tabHeaders).click(function () {
				s.currentIndex = $(this).parent().index();
				for (s.i = 0, s.j = s.collection.length; s.i &lt; s.j; s.i += 1) {
					if (s.i !== s.currentIndex) {
						$(s.tabSections[s.i]).slideUp(s.speed);
					} else {
						$(s.tabSections[s.i]).slideDown(s.speed);
					}
				}
				return false;
			});
		},
		startAnimation: function () {
			s = this.settings;
			s.startButton.click(function() {
				$(&quot;div.target&quot;).toggleClass(&quot;animate&quot;);
				if (s.startButton.attr(&quot;value&quot;) === &quot;ANIMATE THE SCENE&quot;) {
					s.startButton.attr(&quot;value&quot;, &quot;RESET THE ANIMATION&quot;);
				} else {
					s.startButton.attr(&quot;value&quot;, &quot;ANIMATE THE SCENE&quot;);
				}
			});
		}
	};
	AnimationSpace.init();
});
&lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;
</textarea></p>
<p><input type="button" value="运行代码" class="runcode_button" onclick="runcode_open_new('runcode_7qkEes');"/> 提示：您可以先修改部分

代码再运行</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.caihong.cc/?feed=rss2&#038;p=205</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>高薪招人了 Java工程师 架构师 WEB开发 搜索</title>
		<link>http://www.caihong.cc/?p=201</link>
		<comments>http://www.caihong.cc/?p=201#comments</comments>
		<pubDate>Thu, 03 Nov 2011 14:06:24 +0000</pubDate>
		<dc:creator>练习</dc:creator>
				<category><![CDATA[其他]]></category>

		<guid isPermaLink="false">http://www.caihong.cc/?p=201</guid>
		<description><![CDATA[北京搜狐为了构建一个重要互联网产品, 打造一支精英化队伍, 特招聘有理想有抱负的同学, 来实现我们共同的理想! 具体邮件联系 299564@sohu.com 目前正在招聘 Java工程师, 架构师, 搜索工程师, 开放平台工程师 , JS前端开发工程师, WEB页面制作工程师 以下要求仅供参考! __________________________________________________ · Java WEB开发工程师 岗位职责： 1. 负责相关产品的设计开发维护工作, 实现高效稳定的应用 2. 能够根据产品需求，设计产品数据模型, 工作流程, 并实现 3. 与产品、前台开发人员保持良好沟通，能快速理解、消化各方需求； 4. 系统的相关发布, 维护等 任职资格： 1. 用心工作, 有责任心, 对事情有自己的思考 2. 大学本科学历以上，有2年以上Java开发经验, 对Java熟练掌握 3. 良好的编码习惯，较强的沟通、协调、理解能力和良好的责任心和团队合作能力； 4. 熟悉各种开发技术, 例如Spring, Struts2等, 并了解其原理. 5. 熟悉各种数据库, 如Oracle, Mysql的常用SQL 6. 了解各种大型互联网产品的设计, 架构, 对大数据量应用有一定经验 [...]]]></description>
			<content:encoded><![CDATA[<p>北京搜狐为了构建一个重要互联网产品, 打造一支精英化队伍, 特招聘有理想有抱负的同学, 来实现我们共同的理想!</p>
<p>具体邮件联系 299564@sohu.com</p>
<p>目前正在招聘 Java工程师, 架构师, 搜索工程师, 开放平台工程师 , JS前端开发工程师, WEB页面制作工程师</p>
<p>以下要求仅供参考!<span id="more-201"></span><br />
__________________________________________________</p>
<p>· Java WEB开发工程师</p>
<p>        岗位职责：<br />
1.     负责相关产品的设计开发维护工作, 实现高效稳定的应用<br />
2.     能够根据产品需求，设计产品数据模型, 工作流程, 并实现<br />
3.     与产品、前台开发人员保持良好沟通，能快速理解、消化各方需求；<br />
4.     系统的相关发布, 维护等</p>
<p>        任职资格：<br />
1.     用心工作, 有责任心, 对事情有自己的思考<br />
2.     大学本科学历以上，有2年以上Java开发经验, 对Java熟练掌握<br />
3.     良好的编码习惯，较强的沟通、协调、理解能力和良好的责任心和团队合作能力；<br />
4.     熟悉各种开发技术, 例如Spring, Struts2等, 并了解其原理.<br />
5.     熟悉各种数据库, 如Oracle, Mysql的常用SQL<br />
6.    了解各种大型互联网产品的设计, 架构, 对大数据量应用有一定经验<br />
7.     对产品, 用户体验等有一定的理解</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>· Java 运维开发工程师</p>
<p>        工作经验：     2年以上<br />
        职位月薪：     面议<br />
        工作性质：     全职</p>
<p>1.    熟练使用linux操作系统: 系统管理（负载性能监控）, 日志分析处理, 熟悉脚本编写<br />
2.    2年以上JAVA WEB项目开发经验<br />
3.    熟练使用RESIN，对RESIN和JVM配置有深刻了解<br />
4.    熟练使用项目部署相关软件（MAVEN，SVN，ANT等）<br />
5.    熟悉mysql，oracle等常用数据库的管理<br />
6.      用心工作, 有责任心, 对事情有自己的思考<br />
7.      与产品、前后台开发人员保持良好沟通</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>· Java架构工程师</p>
<p>        工作经验：     2年以上(初级), 4年以上(高级)<br />
        职位月薪：     面议<br />
        工作性质：     全职</p>
<p>        岗位职责：<br />
1.    负责大型系统或产品的架构设计, 基础类库设计等<br />
2.     负责相关产品的设计开发工作, 实现高效稳定的应用<br />
3.     能够根据产品需求，设计产品数据模型, 工作流程, 并实现<br />
4.     与产品、前台开发人员保持良好沟通，能快速理解、消化各方需求；</p>
<p>        任职资格：<br />
1.    熟悉大型互联网产品的设计, 架构, 对大数据量应用有一定经验<br />
2.     用心工作, 有责任心, 对事情有自己独特的思考<br />
3.     大学本科学历以上，有2年以上Java开发经验, 对Java熟练掌握<br />
4.     熟悉各种开发技术, 例如Spring, Struts2等, 并了解其原理.<br />
5.     熟悉各种数据库, 如Oracle, Mysql的常用SQL<br />
6.     对产品, 用户体验等有一定的理解</p>
<p>__________________________________________________</p>
<p>· Java搜索架构工程师</p>
<p>        工作经验：     2年以上(初级), 4年以上(高级)<br />
        职位月薪：     面议<br />
        工作性质：     全职</p>
<p>        岗位职责：<br />
1.     负责大型系统或产品的搜索架构设计<br />
2.     负责相关搜索产品的设计开发工作, 实现高效稳定的应用<br />
3.     能够根据产品需求，设计产品数据模型, 工作流程, 并实现<br />
4.     与产品、前台开发人员保持良好沟通，能快速理解、消化各方需求；</p>
<p>        任职资格：<br />
1.     熟悉大型互联网内容搜索产品的设计, 架构, 对大数据量搜索应用有一定经验<br />
2.     用心工作, 有责任心, 对事情有自己独特的思考<br />
3.     大学本科学历以上，有2年以上Java开发经验, 对Java熟练掌握<br />
4.     熟悉各种搜索开发技术, 例如lucene, sphinx等, 对分布式搜索有一定经验<br />
5.     熟悉各种数据库的基本应用<br />
6.     对产品, 用户体验等有一定的理解</p>
<p>__________________________________________________</p>
<p>· Java开放平台工程师</p>
<p>        工作经验：     4年以上(高级)<br />
        职位月薪：     面议<br />
        工作性质：     全职</p>
<p>        岗位职责：<br />
1.    负责大型系统或产品的架构设计, 基础类库设计等<br />
2.     负责相关开放平台产品的设计开发工作, 实现高效稳定的应用<br />
3.     能够根据产品需求，设计产品数据模型, 工作流程, 并实现<br />
4.     与产品、前台开发人员保持良好沟通，能快速理解、消化各方需求；</p>
<p>        任职资格：<br />
1.    熟悉大型互联网产品的开放平台设计, 架构, 对大数据量接入应用有一定经验<br />
2.     熟悉各种服务接入技术, 如Web Service, Rest 以及相应的路由/负载均衡/监测技术<br />
3.     大学本科学历以上，有4年以上Java开发经验, 对Java熟练掌握<br />
4.     熟悉各种开发技术, 例如Spring, Struts2等, 并了解其原理.<br />
5.     用心工作, 有责任心, 对事情有自己独特的思考<br />
6.     对产品, 用户体验等有一定的理解</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>· JS前端开发工程师</p>
<p>        招聘人数：     5<br />
        学历要求：     本科<br />
        工作经验：     2年以上<br />
        职位月薪：     面议<br />
        工作性质：     全职</p>
<p>        岗位职责：<br />
1.     负责搜狐相关产品的前端开发工作，使用Javascript实现高性能的交互效果；<br />
2.     能够根据产品需求，熟练运用(x)HTML,CSS产出兼容于目前主流浏览器的前端页面；<br />
3.     负责相关产品的需求以及前端程序的实现，提供合理的前端架构；<br />
4.     与产品、后台开发人员保持良好沟通，能快速理解、消化各方需求，并落实为具体的开发工作；<br />
5.     了解服务器端的相关工作，在交互体验、产品设计等方面有自己的见解。</p>
<p>        任职资格：<br />
1.     大学本科学历以上，有2年以上web前端开发经验；<br />
2.     熟悉各种Web前端技术（XHTML/XML/CSS/Javascript/Ajax等），精通XHTML/CSS/Javascript；<br />
3.     对Javascript面向对象编程具有深入的了解；至少熟悉目前主流的Javascript库中的一种，如：Jquery,mootools,prototype等；<br />
4.     熟悉W3C标准和各主流浏览器在前端开发中的差异，能熟练运用(x)HTML、CSS，提供针对不同浏览器的前端页面解决方案；<br />
5.     对用户体验，交互设计等有深入的理解；对前端页面代码结构及前端交互性能有深入的理解；<br />
6.     良好的编码习惯，较强的沟通、协调、理解能力和良好的责任心和团队合作能力；<br />
7.     熟悉Web服务器端编程语言优先考虑（Java/JSP优先）；</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>· 前端页面制作工程师</p>
<p>        招聘人数：     3<br />
        学历要求：     本科<br />
        工作经验：     2年以上<br />
        职位月薪：     面议<br />
        工作性质：     全职</p>
<p>        岗位职责：<br />
1.     负责搜狐相关产品的前端页面制作工作，使用Div+css方式制作高效简介的页面；<br />
2.     能够根据产品需求，熟练运用(x)HTML,CSS产出兼容于目前主流浏览器的前端页面；<br />
3.     负责相关产品的需求以及前端程序的实现，提供合理的前端架构；<br />
4.     与产品, JS开发,后台开发人员保持良好沟通，能快速理解、消化各方需求，并落实为具体的开发工作；<br />
5.     了解服务器端的相关工作，在交互体验、产品设计等方面有自己的见解。</p>
<p>        任职资格：<br />
1.     大学本科学历以上，有2年以上web前端开发经验；<br />
2.     熟悉各种Web前端技术（XHTML/XML/CSS/Javascript/Ajax等），精通XHTML/Html/CSS；<br />
3.     对Javascript面向对象编程具有了解；<br />
4.     熟悉W3C标准和各主流浏览器在前端开发中的差异，能熟练运用(x)HTML、CSS，提供针对不同浏览器的前端页面解决方案；<br />
5.     对用户体验，交互设计等有深入的理解；对前端页面代码结构及前端交互性能有深入的理解；<br />
6.     良好的编码习惯，较强的沟通、协调、理解能力和良好的责任心和团队合作能力；</p>
]]></content:encoded>
			<wfw:commentRss>http://www.caihong.cc/?feed=rss2&#038;p=201</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Aptana Studio3的汉化</title>
		<link>http://www.caihong.cc/?p=198</link>
		<comments>http://www.caihong.cc/?p=198#comments</comments>
		<pubDate>Mon, 31 Oct 2011 01:42:55 +0000</pubDate>
		<dc:creator>练习</dc:creator>
				<category><![CDATA[其他]]></category>

		<guid isPermaLink="false">http://www.caihong.cc/?p=198</guid>
		<description><![CDATA[点击 “Help” > “Install New Software”； 在弹出的“install”窗口中的“Work With”的输入框中填上如下网址： http://archive.eclipse.org/technology/babel/update-site/R0.8.1/helios 然后，点击“add”按钮，正文会出现语言包列表，选择中文简体，接着的大家都知道了，一路“next”，直到“finish”； “install”窗口关闭后，Aptana 3 会自动下载语言包并安装，安装完毕后，它会提示你重启Aptana，至此，你的Aptana 3 就是可爱的中文版啦。]]></description>
			<content:encoded><![CDATA[<p>点击 “Help” > “Install New Software”；</p>
<p>在弹出的“install”窗口中的“Work With”的输入框中填上如下网址：</p>
<p>http://archive.eclipse.org/technology/babel/update-site/R0.8.1/helios</p>
<p>然后，点击“add”按钮，正文会出现语言包列表，选择中文简体，接着的大家都知道了，一路“next”，直到“finish”；</p>
<p><span id="more-198"></span></p>
<p>“install”窗口关闭后，Aptana 3 会自动下载语言包并安装，安装完毕后，它会提示你重启Aptana，至此，你的Aptana 3 就是可爱的中文版啦。 </p>
]]></content:encoded>
			<wfw:commentRss>http://www.caihong.cc/?feed=rss2&#038;p=198</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IE6下相对定位的块在展开收回的结构里滞留原地</title>
		<link>http://www.caihong.cc/?p=191</link>
		<comments>http://www.caihong.cc/?p=191#comments</comments>
		<pubDate>Sat, 15 Oct 2011 02:23:39 +0000</pubDate>
		<dc:creator>练习</dc:creator>
				<category><![CDATA[表现]]></category>

		<guid isPermaLink="false">http://www.caihong.cc/?p=191</guid>
		<description><![CDATA[IE6下所有需要展开收回的布局里只要有position，就会造成position的块无法跟随滞留在原地。解决的办法是精确的找到其不动的父容器使其relative，如找不到完全不动的父容器就让body获得。嗯]]></description>
			<content:encoded><![CDATA[<p>IE6下所有需要展开收回的布局里只要有position，就会造成position的块无法跟随滞留在原地。解决的办法是精确的找到其不动的父容器使其relative，如找不到完全不动的父容器就让body获得。<span id="more-191"></span>嗯</p>
]]></content:encoded>
			<wfw:commentRss>http://www.caihong.cc/?feed=rss2&#038;p=191</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Firefox 7正式支持 text-overflow: ellipsis终于赶上IE6的脚步</title>
		<link>http://www.caihong.cc/?p=181</link>
		<comments>http://www.caihong.cc/?p=181#comments</comments>
		<pubDate>Sun, 09 Oct 2011 07:15:23 +0000</pubDate>
		<dc:creator>练习</dc:creator>
				<category><![CDATA[表现]]></category>

		<guid isPermaLink="false">http://www.caihong.cc/?p=181</guid>
		<description><![CDATA[Summary The text-overflow CSS property determines whether an ellipsis (&#8220;…&#8221;) displays when text content has overflowed its given layout area. To force overflow to occur and ellipses to be applied, the author must apply some additional properties on the element. See example below. Syntax text-overflow: ellipsis &#124; clip Values ellipsis Display ellipses … (U+2026, &#8230;) [...]]]></description>
			<content:encoded><![CDATA[<p>Summary</p>
<p>The text-overflow CSS property determines whether an ellipsis (&#8220;…&#8221;) displays when text content has overflowed its given layout area. To force overflow to occur and ellipses to be applied, the author must apply some additional properties on the element. See example below.</p>
<p><span id="more-181"></span></p>
<p>Syntax</p>
<p>text-overflow:  ellipsis | clip</p>
<p>Values</p>
<p>ellipsis</p>
<p>Display ellipses … (U+2026, &hellip;) to represent clipped text.</p>
<p>clip</p>
<p>Default value, clips text.</p>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline">p {&nbsp; </li>
<li>&nbsp;&nbsp; &nbsp; &nbsp;white-space: nowrap;&nbsp; </li>
<li>&nbsp;&nbsp; &nbsp; &nbsp;width: 100%;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;/* IE6 needs any width */&nbsp; </li>
<li>&nbsp;&nbsp; &nbsp; &nbsp;overflow: hidden;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /* &quot;overflow&quot; value must be different from &quot;visible&quot; */&nbsp; &nbsp;</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp;</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp;-o-text-overflow: ellipsis;&nbsp; &nbsp; /* Opera 9-10 */&nbsp; </li>
<li>&nbsp;&nbsp; &nbsp; &nbsp;text-overflow:&nbsp; &nbsp; ellipsis;&nbsp; &nbsp; /* IE, WebKit (Safari, Chrome), Firefox 7, Opera 11 */&nbsp; </li>
<li>&nbsp;&nbsp; &nbsp;}</li></ol></div>
]]></content:encoded>
			<wfw:commentRss>http://www.caihong.cc/?feed=rss2&#038;p=181</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>关于IE6下绝对定位元素莫名消失的问题</title>
		<link>http://www.caihong.cc/?p=179</link>
		<comments>http://www.caihong.cc/?p=179#comments</comments>
		<pubDate>Tue, 16 Aug 2011 04:50:39 +0000</pubDate>
		<dc:creator>练习</dc:creator>
				<category><![CDATA[结构]]></category>
		<category><![CDATA[表现]]></category>

		<guid isPermaLink="false">http://www.caihong.cc/?p=179</guid>
		<description><![CDATA[这是个很老的bug了，我想一般大家都遇到过，以前我是纯凭经验，让绝对定位的元素不挨着浮动元素就OK了，不过一直没去研究它形成的原因。今天做页面又遇到了这个可爱的BUG，本着一探究竟的心态google了一下。在蓝色理想发现了这样的几条解释： 1.当绝对定位层的邻近浮动层的宽度不等于父层宽度时，以及没有清除浮动时，IE6/7，FF中显示一致； 2.当绝对定位层的邻近浮动层的宽度不等于父层宽度时，有清除浮动时，IE6/7不显示绝对定位层，FF显示； 3.当绝对定位层的邻近浮动层的宽度等于父层宽度时，以及没有清除浮动时，IE6不显示绝对定位层，IE7/FF显示； 4.当绝对定位层的邻近浮动层的宽度等于父层宽度时，有清除浮动时，IE6/7不显示绝对定位层，FF显示； 就目前来说我个人的解决办法有两条，第一取消浮动，第二让绝对定位的元素不要挨着浮动的标签。蓝色上那位哥们提出了另一个办法，就是在绝对定位的层跟浮动层中间插个空的标签。]]></description>
			<content:encoded><![CDATA[<p>这是个很老的bug了，我想一般大家都遇到过，以前我是纯凭经验，让绝对定位的元素不挨着浮动元素就OK了，不过一直没去研究它形成的原因。今天做页面又遇到了这个可爱的BUG，本着一探究竟的心态google了一下。在蓝色理想发现了这样的几条解释：</p>
<p><span id="more-179"></span></p>
<p><strong>1.当绝对定位层的邻近浮动层的宽度不等于父层宽度时，以及没有清除浮动时，IE6/7，FF中显示一致；</strong></p>
<p><strong>2.当绝对定位层的邻近浮动层的宽度不等于父层宽度时，有清除浮动时，IE6/7不显示绝对定位层，FF显示；</strong></p>
<p><strong>3.当绝对定位层的邻近浮动层的宽度等于父层宽度时，以及没有清除浮动时，IE6不显示绝对定位层，IE7/FF显示；</strong></p>
<p><strong>4.当绝对定位层的邻近浮动层的宽度等于父层宽度时，有清除浮动时，IE6/7不显示绝对定位层，FF显示；</strong></p>
<p>就目前来说我个人的解决办法有两条，第一取消浮动，第二让绝对定位的元素不要挨着浮动的标签。蓝色上那位哥们提出了另一个办法，就是在绝对定位的层跟浮动层中间插个空的标签。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.caihong.cc/?feed=rss2&#038;p=179</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>关于article,section,div,以及figure标签</title>
		<link>http://www.caihong.cc/?p=166</link>
		<comments>http://www.caihong.cc/?p=166#comments</comments>
		<pubDate>Wed, 06 Jul 2011 01:51:27 +0000</pubDate>
		<dc:creator>练习</dc:creator>
				<category><![CDATA[结构]]></category>

		<guid isPermaLink="false">http://www.caihong.cc/?p=166</guid>
		<description><![CDATA[写到现在还是不太精于这几个标签的使用,大体上明白div,section,article从语义上由弱到强.看了一下淘宝等几个网站的用法也不尽一样.淘宝貌似把section类似于 &#60;div class=section&#62; 来使用了. 我在读到的文档里提过一条 section 应该至少有一个H标题,如果section里没有用到H标题,那么也许这个标签并不适合使用section.而我看到的大部分实例里边,section都是一个布局块而已. figure的手册说明里是用来整理标签,我看现在大多实例的用法是框缩略图或者标题,另外加上描述. &#8230;.求各种指教开导&#8230;]]></description>
			<content:encoded><![CDATA[<p>写到现在还是不太精于这几个标签的使用,大体上明白div,section,article从语义上由弱到强.看了一下淘宝等几个网站的用法也不尽一样.淘宝貌似把section类似于
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline">&lt;div class=section&gt;</li></ol></div>
<p>来使用了.<br />
我在读到的文档里提过一条 section 应该至少有一个H标题,如果section里没有用到H标题,那么也许这个标签并不适合使用section.而我看到的大部分实例里边,section都是一个布局块而已.</p>
<p><span id="more-166"></span></p>
<p>figure的手册说明里是用来整理标签,我看现在大多实例的用法是框缩略图或者标题,另外加上描述.</p>
<p>&#8230;.求各种指教开导&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.caihong.cc/?feed=rss2&#038;p=166</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>[转]不要告诉我你懂margin(标题好嚣张啊)</title>
		<link>http://www.caihong.cc/?p=162</link>
		<comments>http://www.caihong.cc/?p=162#comments</comments>
		<pubDate>Wed, 22 Jun 2011 02:10:04 +0000</pubDate>
		<dc:creator>练习</dc:creator>
				<category><![CDATA[表现]]></category>

		<guid isPermaLink="false">http://www.caihong.cc/?p=162</guid>
		<description><![CDATA[你真的了解margin吗？你知道margin有什么特性吗？你知道什么是垂直外边距合并？margin在块元素、内联元素中的区别？什么时候该用 padding而不是margin？你知道负margin吗？你知道负margin在实际工作中的用途吗？常见的浏览器下margin出现的bug有哪些？…… 写css，你少不了与margin打交道，而对于这个平时我们最常用的css属性我们并非十分了解。介于此我打算写下这篇文章，一来是自己工作中的总结，也是对自己知识的一次梳理。 Margin是什么 CSS 边距属性定义元素周围的空间。通过使用单独的属性，可以对上、右、下、左的外边距进行设置。也可以使用简写的外边距属性同时改变所有的外边距。——W3School 边界，元素周围生成额外的空白区。“空白区”通常是指其他元素不能出现且父元素背景可见的区域。——CSS权威指南 我比较喜欢使用“外边距”这个词来解释margin（同理padding可以称之为“内边距”，但是我又恰恰喜欢称呼padding为“补白”或者“留白”），我们可以很清楚的了解到margin的最基本用途就是控制元素周围空间的间隔，从视觉角度上达到相互隔开的目的。 Margin的特性 margin始终是透明的。 margin通过使用单独的属性，可以对上、右、下、左的外边距进行设置。即：margin-top、margin-right、margin-bottom、margin-left。 外边距的 margin-width 的值类型有：auto &#124; length &#124; percentage 也可以使用简写的外边距属性同时改变所有的外边距：margin: top right bottom left;(eg: margin:10px 20px 30px 40px) 记忆方式是元素周围正上方顺时针“上右下左”记忆。 并且规范还提供了省略的数值写法，基本如下： 1、如果margin只有一个值，表示上右下左的margin同为这个值。例如：margin:10px; 就等于 margin:10px 10px 10px 10px; 2、如果 margin 只有两个值，第一个值表示上下margin值，第二个值为左右margin的值。例如：margin:10px 20px; 就等于 margin:10px 20px 10px 20px; 3、如果margin有三个值，第一个值表示上margin值，第二个值表示左右margin的值，第三个值表示下margin的值。例如：margin:10px 20px 30px; 就等于 margin:10px 20px 30px 20px; 4、如果margin有四个值，那这四个值分别对应上右下左这四个margin值。例如：margin:10px 20px 30px [...]]]></description>
			<content:encoded><![CDATA[<p>你真的了解margin吗？你知道margin有什么特性吗？你知道什么是垂直外边距合并？margin在块元素、内联元素中的区别？什么时候该用 padding而不是margin？你知道负margin吗？你知道负margin在实际工作中的用途吗？常见的浏览器下margin出现的bug有哪些？……</p>
<p>写css，你少不了与margin打交道，而对于这个平时我们最常用的css属性我们并非十分了解。介于此我打算写下这篇文章，一来是自己工作中的总结，也是对自己知识的一次梳理。
</p>
<p><span id="more-162"></span></p>
<p>Margin是什么</p>
<p>CSS 边距属性定义元素周围的空间。通过使用单独的属性，可以对上、右、下、左的外边距进行设置。也可以使用简写的外边距属性同时改变所有的外边距。——W3School</p>
<p>边界，元素周围生成额外的空白区。“空白区”通常是指其他元素不能出现且父元素背景可见的区域。——CSS权威指南</p>
<p>我比较喜欢使用“外边距”这个词来解释margin（同理padding可以称之为“内边距”，但是我又恰恰喜欢称呼padding为“补白”或者“留白”），我们可以很清楚的了解到margin的最基本用途就是控制元素周围空间的间隔，从视觉角度上达到相互隔开的目的。</p>
<p>Margin的特性</p>
<p>margin始终是透明的。</p>
<p>margin通过使用单独的属性，可以对上、右、下、左的外边距进行设置。即：margin-top、margin-right、margin-bottom、margin-left。</p>
<p>外边距的 margin-width 的值类型有：auto | length | percentage</p>
<p>也可以使用简写的外边距属性同时改变所有的外边距：margin: top right bottom left;(eg: margin:10px 20px 30px 40px) 记忆方式是元素周围正上方顺时针“上右下左”记忆。</p>
<p>并且规范还提供了省略的数值写法，基本如下：</p>
<p>1、如果margin只有一个值，表示上右下左的margin同为这个值。例如：margin:10px; 就等于 margin:10px 10px 10px 10px;</p>
<p>2、如果 margin 只有两个值，第一个值表示上下margin值，第二个值为左右margin的值。例如：margin:10px 20px; 就等于 margin:10px 20px 10px 20px;</p>
<p>3、如果margin有三个值，第一个值表示上margin值，第二个值表示左右margin的值，第三个值表示下margin的值。例如：margin:10px 20px 30px; 就等于 margin:10px 20px 30px 20px;</p>
<p>4、如果margin有四个值，那这四个值分别对应上右下左这四个margin值。例如：margin:10px 20px 30px 40px;</p>
<p>在实际应用中，个人不推荐使用三个值的margin，一是容易记错，二是不容易日后修改，一开始如果写成margin:10px 20px 30px;日后需求改动为上10px，右30px，下30px，左20px，你不得不还是得把这个margin拆开为margin:10px 30px 30px 20px;费力且不讨好，不如一开始就老老实实的写成margin:10px 20px 30px 20px;来的实在，不要为了现在节省俩个字节而让日后再次开发的成本上升。</p>
<p>垂直外边距合并问题</p>
<p>别被上面这个名词给吓倒了，简单地说，外边距合并指的是，当两个垂直外边距相遇时，它们将形成一个外边距。合并后的外边距的高度等于两个发生合并的外边距的高度中的较大者。你可以查看W3Shool CSS外边距合并了解这个基本知识。</p>
<p>实际工作中，垂直外边距合并问题常见于第一个子元素的margin-top会顶开父元素与父元素相邻元素的间距，而且只在标准浏览器下 (FirfFox、Chrome、Opera、Sarfi)产生问题，IE下反而表现良好。例子可以查看下面代码(IE下表现“正常”，标准浏览器下查看出现“bug”)：</p>
<div class="runcode">
<p><textarea name="runcode" class="runcode_text" 

id="runcode_YTt00S">
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
&lt;head&gt;
&lt;title&gt;垂直外边距合并&lt;/title&gt;
&lt;style&gt;
.top{width:160px; height:50px; background:#ccf;}
.middle{width:160px; background:#cfc;}
.middle .firstChild{margin-top:20px;}
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div class=&quot;top&quot;&gt;&lt;/div&gt;
&lt;div class=&quot;middle&quot;&gt;
  &lt;div class=&quot;firstChild&quot;&gt;我其实只是想和我的父元素隔开点距离。&lt;/div&gt;
  &lt;div class=&quot;secondChild&quot;&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
</textarea></p>
<p><input type="button" value="运行代码" class="runcode_button" onclick="runcode_open_new('runcode_YTt00S');"/> 提示：您可以先修改部分

代码再运行</p>
</div>
<p>如果按照CSS规范，IE的“良好表现”其实是一个错误的表现，因为IE的hasLayout渲染导致了这个“表现良好”的外观。而其他标准浏览器则会表现出“有问题”的外观。好了，如果你读过了上面W3Shcool的CSS外边距合并的文章后，就很容易讨论这个问题了。这个问题发生的原因是根据规范，一个盒子如果没有上补白(padding-top)和上边框(border-top)，那么这个盒子的上边距会和其内部文档流中的第一个子元素的上边距重叠。</p>
<p>再说了白点就是：父元素的第一个子元素的上边距margin-top如果碰不到有效的border或者padding.就会不断一层一层的找自己 “领导”(父元素，祖先元素)的麻烦。只要给领导设置个有效的 border或者padding就可以有效的管制这个目无领导的margin防止它越级，假传圣旨，把自己的margin当领导的margin执行。<br />
对于垂直外边距合并的解决方案上面已经解释了，为父元素例子中的middle元素增加一个border-top或者padding-top即可解决这个问题。</p>
<p>一般说来这个问题解释到这里，大多数文章就不会再深入下去了，但作为一名实战开发者，最求的是知其然知其所以然，原本使用margin-top就是为了与父元素隔开距离，而按照你这么一个解法，其实是一种“修复”，为了“弥补修复”这个父子垂直外边距合并这个CSS规范“Bug”，而强制在父元素上使用border-top和padding-top，不舒服，也不容易记住，下次再发生这样的情况还是会忘记这条准则，而且在页面设计稿里如果不需要 border-top加个上边框，这么一加反而画蛇添足，为以后修改留下隐患。</p>
<p>为什么一定要用border-top,padding-top去为了这么一个所谓的标准规范而多写这么一行代码呢？答案你可以参考另外一篇文章用Margin还是用Padding里找到答案。</p>
<p>用Margin还是用Padding</p>
<p>何时应当使用margin：</p>
<p>需要在border外侧添加空白时。</p>
<p>空白处不需要背景（色）时。</p>
<p>上下相连的两个盒子之间的空白，需要相互抵消时。如15px + 20px的margin，将得到20px的空白。</p>
<p>何时应当时用padding：</p>
<p>需要在border内测添加空白时。</p>
<p>空白处需要背景（色）时。</p>
<p>上下相连的两个盒子之间的空白，希望等于两者之和时。如15px + 20px的padding，将得到35px的空白。</p>
<p>个人认为：margin是用来隔开元素与元素的间距；padding是用来隔开元素与内容的间隔。margin用于布局分开元素使元素与元素互不相干；padding用于元素与内容之间的间隔，让内容（文字）与（包裹）元素之间有一段“呼吸距离”。</p>
<p>这里我截取了部分另外一篇文章的内容，详细内容请见用Margin还是用Padding</p>
<p>margin在块元素、内联元素中的区别</p>
<p>HTML（这里说的是html标准，而不是xhtml）里分两种基本元素，即block和inline。顾名思义，block元素就是以”块”表现的元素（block-like elements），inline元素即是以”行”表现的元素（character level elements and text strings）。二者表现的主要差别在于，在页面文档中block元素另起一行开始，并独占一行。inline元素则同其他inline元素共处一行。</p>
<p>block元素（块元素）大致有：P|H1|H2|H3|H4|H5|H6|UL|OL|PRE| DL | DIV | NOSCRIPT | BLOCKQUOTE | FORM | HR | TABLE | FIELDSET | ADDRESS(随着html5标准的推进，一些元素将被废除，而一些新的元素将被引入)注意的是并非所有的block元素的默认display属性都是 block，像table这种display:table的元素也是block元素。</p>
<p>inline元素（内联元素）大致有：#PCDATA（即文本）| TT | I | B | BIG | SMALL|EM | STRONG | DFN | CODE |SAMP | KBD | VAR | CITE | ABBR | ACRONYM|A | IMG | OBJECT | BR | SCRIPT | MAP | Q | SUB | SUP | SPAN | BDO|INPUT | SELECT | TEXTAREA | LABEL | BUTTON</p>
<p>其中有类特殊的元素：如img|input|select|textarea|button|label等，他们被称为可置换元素（Replaced element）。他们区别一般inline元素（相对而言，称non-replaced element）是：这些元素拥有内在尺寸(intrinsic dimensions),他们可以设置width/height属性。他们的性质同设置了display:inline-block的元素一致。</p>
<p>或许有朋友对非置换元素（non-replaced element）有点疑惑，稍微帮助大家理解一下。非置换元素，W3C 中没有给出明确的定义，但我们从字面可以理解到，非置换元素对应着置换元素（replaced element），也就是说我们搞懂了置换元素的含义，就懂了非置换元素。置换元素，W3C中给出了定义：
</p>
<p>“An element that is outside the scope of the CSS formatter, such as an image, embedded document, or applet”</p>
<p>从定义中我们可以理解到，置换元素（replaced element）主要是指 img, input, textarea, select, object 等这类默认就有 CSS 格式化外表范围的元素。进而可知，非置换元素（non-replaced element）就是除了 img, input, textarea, select, object 等置换元素以外的元素。</p>
<p>margin在块级元素下，他的性能可以完全体现，上下左右任你设定。且记住块级元素的margin的参照基准是前一个元素即相对于自身之前的元素有margin距离。如果元素是第一个元素，则就是相对于父元素的margin距离（但第一个元素相对于父元素margin-top而父元素又没有设定 padding-top/border-top的话要需要印证上面的垂直外边距合并的知识）</p>
<p>margin也能用于内联元素，这是规范所允许的，但是margin-top和margin-bottom对内联元素（对行）的高度没有影响，并且由于边界效果(margin效果)是透明的，他也没有任何的视觉影响。</p>
<p>这是因为边界应用于内联元素时不改变元素的行高度，如果你要改变内联元素的行高即类似文本的行间距，那么你只能使用这三个属性：line- height，fong-size，vertical-align。请记住，这个影响内联元素高度的是line-height而不是height，因为内联元素是一行行的，定一个height的话，那这到底是整段inline元素的高呢？还是inline元素一行的高呢？这都说不准，所以统一都给每行定一个高，只能是line-height了。</p>
<p>margin-top/margin-bottom对内联元素没有多大实际效果，不过margin-left/margin-right还是能够对内联元素产生影响的。应用margin:10px 20px 30px 40px;，左边这个css如果写在inline元素上，他的效果大致是，上下无效果，左边离他相邻元素或者文本距离为40px，右边离他相邻元素或者文本距离为20px。你可以自行尝试一番。</p>
<p>最后在内联元素中还有上文我们提到的非可置换inline元素（non-replaced element），这些个元素img|input|select|textarea|button|label虽然是内联元素，但margin依旧可以影响到他的上下左右！</p>
<p>总结下来margin 属性可以应用于几乎所有的元素，除了表格显示类型（不包括 table-caption, table and inline-table）的元素，而且垂直外边距对非置换内联元素（non-replaced inline element）不起作用。</p>
<p>常见的浏览器下margin出现的bug</p>
<p>林林总总写了那么多，最后总结一些浏览器中常见的margin Bug吧，以后遇到margin下的布局问题可以查看这里找到解决的方案，如果你还发现其他关于浏览器下margin的Bug你可以发表留言，核对采纳后我会及时添加进去，感谢你的分享：</p>
<p>IE6中双边距Bug：</p>
<p>发生场合：当给父元素内第一个浮动元素设置margin-left（元素float:left）或margin-right（元素float:right）时margin加倍。</p>
<p>解决方法：是给浮动元素加上display:inline;CSS属性；或者用padding-left代替margin-left。</p>
<p>原理分析：块级对象默认的display属性值是block，当设置了浮动的同时，还设置了它的外边距就会出现这种情况。也许你会问：“为什么之后的对象和第一个对象之间就不存在双倍边距的Bug”？因为浮动都有其相对应的对象，只有相对于其父对象的浮动对象才会出现这样的问题。第一个对象是相对父对象的，而之后对象是相对第一个对象的，所以之后对象在设置后不会出现问题。为什么display:inline可以解决这个双边距bug，首先是 inline元素或inline-block元素是不存在双边距问题的。然后，float:left等浮动属性可以让inline元素 haslayout，会让inline元素表现得跟inline-block元素的特性一样，支持高宽，垂直margin和padding等，所以div class的所有样式可以用在这个display inline的元素上。</p>
<p>IE6中浮动元素3px间隔Bug：</p>
<p>发生场合：发生在一个元素浮动，然后一个不浮动的元素自然上浮与之靠近会出现的3px的bug。</p>
<p>解决方法：右边元素也一起浮动；或者为右边元素添加IE6 Hack _margin-left:-3px;从而消除3px间距。</p>
<p>原理分析：IE6浏览器缺陷Bug。</p>
<p>IE6/7负margin隐藏Bug：</p>
<p>发生场合：当给一个有hasLayout的父元素内的非hasLayout元素设置负marin时，超出父元素部分不可见。</p>
<p>解决方法：去掉父元素的hasLayout；或者赋hasLayout给子元素,并添加position:relative;</p>
<p>原理分析：iE6/7独有的hasLayout产生问题。</p>
<p>IE6/7下ul/ol标记消失bug：</p>
<p>发生场合：当ul/ol触发了haslayout并且是在ul/ol上写margin-left，前面默认的ul/ol标记会消失。</p>
<p>解决方法：给li设置margin-left，而不是给ul/ol设置margin-left。</p>
<p>原理分析：IE6/7浏览器Bug</p>
<p>IE6/7下margin与absolute元素重叠bug：</p>
<p>发生场合：双栏自适应布局中，左侧元素absolute绝对定位，右侧的margin撑开距离定位。在IE6/7下左侧应用了absolute属性的块级元素与右边的自适应的文字内容重叠。</p>
<p>解决方法：把左侧块级元素更改为内联元素，比如把div更换为span。</p>
<p>原理分析：这是由于IE6/IE7浏览器将inline水平标签元素和block水平的标签元素没有加以区分一视同仁渲染了。属于IE6/7浏览器渲染Bug。</p>
<p>IE6/7/8下auto margin居中bug：</p>
<p>发生场合：给block元素设置margin auto无法居中</p>
<p>解决方法：出现这种bug的原因通常是没有Doctype，然后触发了ie的quirks mode，加上Doctype声明就可以了。在《打败IE的葵花宝典》里给出的方法是给block元素添加一个width能够解决，但根据本人亲测，加 with此种方法是无效的，如果没有Doctype即使给元素添加width也无法让block元素居中。</p>
<p>原理分析：缺少Doctype声明。</p>
<p>IE8下input[button | submit] 设置margin:auto无法居中</p>
<p>发生场合：ie8下，如果给像button这样的标签（如button input[type="button"] input[type="submit"]）设置{ display: block; margin:0 auto; }如果不设置宽度的话无法居中。</p>
<p>解决方法：可以给为input加上宽度</p>
<p>原理分析：IE8浏览器Bug</p>
<p>IE8百分比padding垂直margin bug：</p>
<p>发生场合：当父元素设置了百分比的padding，子元素有垂直的margin的时候，就好像父元素被设置了margin一样。</p>
<p>解决方法：给父元素加一个overflow:hidden/auto。</p>
<p>原理分析：IE8浏览器Bug</p>
<p>原文链接：<a href="http://www.hicss.net/do-not-tell-me-you-understand-margin" target="_blank">http://www.hicss.net/do-not-tell-me-you-understand-margin</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.caihong.cc/?feed=rss2&#038;p=162</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>

