<?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>浮山狼de博客 &#187; css</title>
	<atom:link href="https://www.fushanlang.com/category/programming-skill/css/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.fushanlang.com</link>
	<description>next station - 下一站，活在当下，且行且思</description>
	<lastBuildDate>Sat, 29 Nov 2014 15:14:11 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=4.2.5</generator>
	<item>
		<title>jquery Masonry瀑布流插件(转)</title>
		<link>https://www.fushanlang.com/jquery-masonry-pu-bu-liu-cha-jian-zhuan-2218/</link>
		<comments>https://www.fushanlang.com/jquery-masonry-pu-bu-liu-cha-jian-zhuan-2218/#comments</comments>
		<pubDate>Tue, 07 Aug 2012 04:03:15 +0000</pubDate>
		<dc:creator><![CDATA[fushanlang]]></dc:creator>
				<category><![CDATA[css]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[js]]></category>

		<guid isPermaLink="false">http://www.fushanlang.com/blog/?p=2218</guid>
		<description><![CDATA[<p>如果你经常网上冲浪，这样参差不齐的多栏布局，就象砖块效果砌墙一样，错落有致，是不是很眼熟啊？</p> <p>这种布局适合于小数据块，每个数据块内容相近且没有侧重。通常，随着页面滚动条向下滚动，这种布局还会不断加载数据块并附加至当前尾部。所以，我们给这样的布局起了一个形象的名字 — 瀑布流式布局。</p> <p>Masonry是一款很好用的jquery网页布局插件，它可以去掉不同高度div之间的空白，</p> <p>让你的网页看上去更加的整齐、漂亮！</p> <p>官网插件下载地址以及详解地址：</p> <p>示例demo及文档说明：http://masonry.desandro.com/ （本站离线版下载）</p> <p>你也可以下载打包的html文档在本地查阅：（内含jquery.masonry.min.js 和 jquery.masonry.js 和 实例） Viewing this project locally Via download</p> <p>You can download a zip of all the flat HTML files from http://meta.metafizzy.co/files/masonry-site.zip. 本站下载</p> <p>代码下载地址： https://github.com/desandro/masonry/downloads 本站下载 （里面的demo都有问题，建议还是看上面的官方demo或者本站提供的离线版）</p> <p>以下是官网的实例截图：</p> <p>从这2张图片中就能看到此插件的作用了把！</p> <p>更鲜明的例子，chinaz.com的素材列表页也用了这个jQuery Masonry 插件</p> <p>chinaz.com截图：</p> <p>该如何使用呢，其实很简单，看下代码：</p> test1 test2 test3 test4 </p> <p> // </p> <p>使用说明：</p> <span style="color:#777"> . . . &#8594; Read More: <a href="https://www.fushanlang.com/jquery-masonry-pu-bu-liu-cha-jian-zhuan-2218/">jquery Masonry瀑布流插件(转)</a></span>]]></description>
				<content:encoded><![CDATA[<p>如果你经常网上冲浪，这样参差不齐的多栏布局，就象砖块效果砌墙一样，错落有致，是不是很眼熟啊？</p>
<p>这种布局适合于小数据块，每个数据块内容相近且没有侧重。通常，随着页面滚动条向下滚动，这种布局还会不断加载数据块并附加至当前尾部。所以，我们给这样的布局起了一个形象的名字 — 瀑布流式布局。</p>
<p>Masonry是一款很好用的jquery网页布局插件，它可以去掉不同高度div之间的空白，</p>
<p>让你的网页看上去更加的整齐、漂亮！</p>
<p>官网插件下载地址以及详解地址：</p>
<p>示例demo及文档说明：http://masonry.desandro.com/  （本站离线版下载）</p>
<p>你也可以下载打包的html文档在本地查阅：（内含jquery.masonry.min.js 和 jquery.masonry.js 和 实例）<br />
Viewing this project locally<br />
Via download</p>
<p>You can download a zip of all the flat HTML files from http://meta.metafizzy.co/files/masonry-site.zip.   本站下载</p>
<p>代码下载地址： https://github.com/desandro/masonry/downloads   本站下载 （里面的demo都有问题，建议还是看上面的官方demo或者本站提供的离线版）</p>
<p>以下是官网的实例截图：</p>
<p>从这2张图片中就能看到此插件的作用了把！</p>
<p>更鲜明的例子，chinaz.com的素材列表页也用了这个jQuery Masonry 插件</p>
<p>chinaz.com截图：</p>
<p>该如何使用呢，其实很简单，看下代码：</p>
<div id="”test”">
<div class="”box”">test1</div>
<div class="”box”">test2</div>
<div class="”box”">test3</div>
<div class="”box”">test4 </div>
</p></div>
<p>    <script type="”text/javascript”"> 
    // <![CDATA[  
       $(‘#test’).masonry({  
       singleMode: true,  
       itemSelector: '.box'  
    })  
    // ]]&gt;</script> </p>
<p>使用说明：</p>
<p>配置Masonry相当容易，只需要在jQuery脚本中的wrapping container元素中加上.masonry()方法。</p>
<p>multiple widths:</p>
<p>$(&#8216;#wrapper&#8217;).masonry({ columnWidth: 200 });</p>
<p>same width</p>
<p>$(&#8216;#wrapper&#8217;).masonry({ singleMode: true });</p>
<p>    $(&#8216;#wrapper&#8217;).masonry({  </p>
<p>      singleMode: false,<br />
      // 禁用测量每个浮动元素的宽度。<br />
      // 如果浮动元素具有相同的宽度，设置为true。<br />
      // 默认： false  </p>
<p>      columnWidth: 240,<br />
      // 1列网格的宽度，单位为像素（px）。<br />
      // 默认： 第一个浮动元素外宽度。  </p>
<p>      itemSelector: &#8216;.box:visible&#8217;,<br />
      // 附加选择器，用来指定哪些元素包裹的元素会重新排列。  </p>
<p>      resizeable: true,<br />
      // 绑定一个 Masonry 访问 用来 窗口 resize时布局平滑流动.<br />
      // 默认：true  </p>
<p>      animate: true,<br />
      // 布局重排动画。<br />
      // 默认：false  </p>
<p>      animationOptions: {},<br />
      // 一对动画选项，具体参数可以参考jquery .animate()中的options选项  </p>
<p>      appendedContent: $(&#8216;.new_content&#8217;),<br />
      //  附加选择器元素，用来尾部追加内容。<br />
      // 在集成infinitescroll插件的情况下使用。  </p>
<p>      saveOptions: true,<br />
      // 默认情况下，Masonry 将使用以前Masonry使用过的参数选项,所以你只需要输入一次选项<br />
      // 默认：true  </p>
<p>    },  function() {}<br />
      // 可选择的回调函数<br />
      // &#8216;this&#8217;将指向重排的Masonry适用元素<br />
    );  </p>
<p>BUG：</p>
<p>发现在container窗口的高度计算上，IE与firefox会出现偏差，有可能IE的计算高度比FF的大几十个像素，</p>
<p> 图片瀑布流的简单做法：</p>
<p>这里只说说等宽的图片瀑布流，因为等宽的做出来的效果个人觉得比较好看，</p>
<p>关键是：img的设置，width:100%, 占满整个DIV层，高度height不设置，这样就可以实现了图片能根据宽度等比例缩放，不变形，</p>
<p>而考虑到如果没有这个JS插件失效的情况也能够正常显示，所以给每个box都添加了float:left;浮动和边距</p>
<p>这里的box宽度可以根据container的宽度除以你想一行出现的图片数得到估算值。</p>
<div id="container" style="width:">
<div style="width:200px； float:left；margin:0px 5px">
         <img style="width:100%" />
      </div>
<div style="width:200px； float:left；margin:0px 5px">
         <img style="width:100%" />
      </div>
<div style="width:200px； float:left；margin:0px 5px">
         <img style="width:100%" />
      </div>
<div style="width:200px； float:left；margin:0px 5px">
         <img style="width:100%" />
      </div>
</p></div>
<p>图片高度BUG修正：</p>
<p>      由于网络传输的速度问题，当浏览器加载了dom，但是img图片还没有加载完毕，这个插件在计算图片高度和定位的时候，就会出错，在firefox和chrome中最为明显，尤其是google chrome.<br />
原因：<br />
在chrome浏览器下测试，在图片加载过程中，img的宽度和高度均为0，而在IE下，则浏览器先给img设定了宽度和高度，所以这个插件在IE下使用正常，但在chrome会出错。而这个插件看了官方的image demo也是如此，box层并没有动态生成一个高度值把布局撑开。</p>
<p>解决办法就是先让所有的图片加载完毕，才执行一次masonry()方法。</p>
<p>代码如下：</p>
<p>    <script> 
    var $img=$('.container img');  
    var imgCount=$img.length;  
    $img.load(function(){  
    imgCount--;  
    if(imgCount==0){$('.container').masonry();}  
    });  
    </script> </p>
<p>或者使用它自带的方法imagesLoaded，http://masonry.desandro.com/demos/images.html</p>
<p>    var $container = $(&#8216;#container&#8217;);  </p>
<p>    $container.imagesLoaded( function(){<br />
      $container.masonry({<br />
        itemSelector : &#8216;.box&#8217;<br />
      });<br />
    }); </p>
<p>当然了，这样子的话，在加载图片的时候，你会先看到图片简单的排列而已，没有砖块瀑布流的效果，只有当所有图片加载完成后才会出现砖块效果。所以，至于以上代码加不加，就要考虑你的网站的访问速度了！</p>
]]></content:encoded>
			<wfw:commentRss>https://www.fushanlang.com/jquery-masonry-pu-bu-liu-cha-jian-zhuan-2218/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>图片垂直居中CSS</title>
		<link>https://www.fushanlang.com/css-image-vertically-1898/</link>
		<comments>https://www.fushanlang.com/css-image-vertically-1898/#comments</comments>
		<pubDate>Wed, 08 Jun 2011 03:47:32 +0000</pubDate>
		<dc:creator><![CDATA[fushanlang]]></dc:creator>
				<category><![CDATA[css]]></category>

		<guid isPermaLink="false">http://www.fushanlang.com/blog/?p=1898</guid>
		<description><![CDATA[图片垂直居中代码：（IE要求外围div高度是固定的） .box {         /*非IE的主流浏览器识别的垂直居中的方法*/         display: table-cell;         vertical-align:middle;         /*设置水平居中*/         text-align:center;         /* 针对IE的Hack */         *display: block;         *font-size: 175px;/*约为高度的0.873，200*0.873 约为175*/         *font-family:Arial;/*防止非utf-8引起的hack失效问题，如gbk编码*/ <span style="color:#777"> . . . &#8594; Read More: <a href="https://www.fushanlang.com/css-image-vertically-1898/">图片垂直居中CSS</a></span>]]></description>
				<content:encoded><![CDATA[<pre><code>图片垂直居中代码：（IE要求外围div高度是固定的）</code></pre>
<pre><code>.box {
        /*非IE的主流浏览器识别的垂直居中的方法*/
        display: table-cell;
        vertical-align:middle;

        /*设置水平居中*/
        text-align:center;

        /* 针对IE的Hack */
        *display: block;
        *font-size: 175px;/*约为高度的0.873，200*0.873 约为175*/
        *font-family:Arial;/*防止非utf-8引起的hack失效问题，如gbk编码*/

        width:200px;
        height:200px;
        border: 1px solid #eee;
}
.box img {
        /*设置图片垂直居中*/
        vertical-align:middle;
        margin:0 auto;
}

&lt;div class="box"&gt;
        &lt;img src="*.jpg" /&gt;
&lt;/div&gt;</code></pre>
<p><span id="more-1898"></span><br />
以后有更多的关于垂直居中的css技巧，都会更新在此文中。谢谢关注！</p>
]]></content:encoded>
			<wfw:commentRss>https://www.fushanlang.com/css-image-vertically-1898/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS3圆角在IE,Firefox,Chrome,Safari的实现</title>
		<link>https://www.fushanlang.com/css3-rounded-property-firefox-chrome-safaris-implementation-1889/</link>
		<comments>https://www.fushanlang.com/css3-rounded-property-firefox-chrome-safaris-implementation-1889/#comments</comments>
		<pubDate>Tue, 31 May 2011 03:28:46 +0000</pubDate>
		<dc:creator><![CDATA[fushanlang]]></dc:creator>
				<category><![CDATA[css]]></category>
		<category><![CDATA[css-circle]]></category>

		<guid isPermaLink="false">http://www.fushanlang.com/blog/?p=1889</guid>
		<description><![CDATA[ <p>&#160;</p> <p>Firefox的圆角属性：</p> <p>如果你想设置四个角都是一样圆角的话，可以像这样子直接设置-moz-border-radius:5px; 也可以单独设置元素的上左、上右、下右、下左四个角的值，分别用</p> -moz-border-radius-topleft -moz-border- radius-topright -moz-border-radius-bottomright -moz-border-radius- bottomleft <p>来设置。 也可以用合并起来一起设置如:-moz-border-radius:5px 0 5px 0;</p> <p>对chrome、Safari这两个webkit内核的浏览器来说，是用-webkit-border-radius来实现的。</p> <p>如果你想设置四个角都是一样圆角的话，依然可以像这样子直接设置-moz-border-radius:3px;</p> <p>如果是单独设置四个角的话，需要采取这种方式</p> -webkit-border-top-left-radius:5px 10px; -webkit-border-top-right-radius:5px 10px; -webkit-border-bottom-right-radius:5px 10px; -webkit-border-bottom-left-radius:5px 10px; <p>如果是要合并的话，只支持-webkit-border-radius:3px;或者是这样子-webkit-border-radius:3px 4px;使用-webkit-border-radius:5px 0 5px 0;将不会有任何效果。</p> <p>对于IE浏览器，由于对CSS3支持欠佳，可以考虑加入behavior属性。 </p> <p>不同浏览器下的综合一下可以这样写：</p> -moz-border-radius: 5px; -khtml-border-radius: 5px; -webkit-border-radius: 5px; border-radius: 5px; behavior: url(ie-circle-css3.htc); <p>如果要圆角效果，外加圆角背景的话可以借助border设置：</p> border-width:10px; border-color:#000; border-style:solid; <p>中间引入的ie-circle-css3.htc 内容如下：</p> // = limit) <span style="color:#777"> . . . &#8594; Read More: <a href="https://www.fushanlang.com/css3-rounded-property-firefox-chrome-safaris-implementation-1889/">CSS3圆角在IE,Firefox,Chrome,Safari的实现</a></span>]]></description>
				<content:encoded><![CDATA[<h2></h2>
<p>&nbsp;</p>
<p><strong>Firefox的圆角属性：</strong></p>
<p>如果你想设置四个角都是一样圆角的话，可以像这样子直接设置-moz-border-radius:5px;<br />
也可以单独设置元素的上左、上右、下右、下左四个角的值，分别用</p>
<pre class="css" name="code">
-moz-border-radius-topleft
-moz-border- radius-topright
-moz-border-radius-bottomright
-moz-border-radius- bottomleft</pre>
<p>来设置。<br />
也可以用合并起来一起设置如:-moz-border-radius:5px 0 5px 0;</p>
<p><strong>对chrome、Safari这两个webkit内核的浏览器来说，是用-webkit-border-radius来实现的。</strong></p>
<p><strong></strong>如果你想设置四个角都是一样圆角的话，依然可以像这样子直接设置-moz-border-radius:3px;</p>
<p>如果是单独设置四个角的话，需要采取这种方式</p>
<pre class="css" name="code">-webkit-border-top-left-radius:5px 10px;
-webkit-border-top-right-radius:5px 10px;
-webkit-border-bottom-right-radius:5px 10px;
-webkit-border-bottom-left-radius:5px 10px;</pre>
<p>如果是要合并的话，只支持-webkit-border-radius:3px;或者是这样子-webkit-border-radius:3px 4px;<strong>使用-webkit-border-radius:5px 0 5px 0;将不会有任何效果。</strong></p>
<p><strong>对于IE浏览器</strong>，由于对CSS3支持欠佳，可以考虑加入behavior属性。<br />
<strong></strong></p>
<p><strong>不同浏览器下的综合一下可以这样写：</strong></p>
<pre class="css" name="code">
-moz-border-radius: 5px;
-khtml-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
behavior: url(ie-circle-css3.htc);</pre>
<p>如果要圆角效果，外加圆角背景的话可以借助border设置：</p>
<pre class="css" name="code">
border-width:10px;
border-color:#000;
border-style:solid;
</pre>
<p>中间引入的ie-circle-css3.htc 内容如下：</p>
<pre class="javascript" name="code"><script type="text/javascript">// <![CDATA[
timer_length = 200; // Milliseconds
border_opacity = false; // Use opacity on borders of rounded-corner elements? Note: This causes antialiasing issues

// supportsVml() borrowed from http://stackoverflow.com/questions/654112/how-do-you-detect-support-for-vml-or-svg-in-a-browser
function supportsVml() {
	if (typeof supportsVml.supported == "undefined") {
		var a = document.body.appendChild(document.createElement('div'));
		a.innerHTML = '<v:shape id="vml_flag1" adj="1" />';
		var b = a.firstChild;
		b.style.behavior = "url(#default#VML)";
		supportsVml.supported = b ? typeof b.adj == "object": true;
		a.parentNode.removeChild(a);
	}
	return supportsVml.supported
}

// findPos() borrowed from http://www.quirksmode.org/js/findpos.html
function findPos(obj) {
	var curleft = curtop = 0;

	if (obj.offsetParent) {
		do {
			curleft += obj.offsetLeft;
			curtop += obj.offsetTop;
		} while (obj = obj.offsetParent);
	}

	return({
		'x': curleft,
		'y': curtop
	});
}

function createBoxShadow(element, vml_parent) {
	var style = element.currentStyle['iecss3-box-shadow'] || element.currentStyle['-moz-box-shadow'] || element.currentStyle['-webkit-box-shadow'] || element.currentStyle['box-shadow'] || '';
	var match = style.match(/^(\d+)px (\d+)px (\d+)px/);
	if (!match) { return(false); }

	var shadow = document.createElement('v:roundrect');
	shadow.userAttrs = {
		'x': parseInt(RegExp.$1 || 0),
		'y': parseInt(RegExp.$2 || 0),
		'radius': parseInt(RegExp.$3 || 0) / 2
	};
	shadow.position_offset = {
		'y': (0 - vml_parent.pos_ieCSS3.y - shadow.userAttrs.radius + shadow.userAttrs.y),
		'x': (0 - vml_parent.pos_ieCSS3.x - shadow.userAttrs.radius + shadow.userAttrs.x)
	};
	shadow.size_offset = {
		'width': 0,
		'height': 0
	};
	shadow.arcsize = element.arcSize +'px';
	shadow.style.display = 'block';
	shadow.style.position = 'absolute';
	shadow.style.top = (element.pos_ieCSS3.y + shadow.position_offset.y) +'px';
	shadow.style.left = (element.pos_ieCSS3.x + shadow.position_offset.x) +'px';
	shadow.style.width = element.offsetWidth +'px';
	shadow.style.height = element.offsetHeight +'px';
	shadow.style.antialias = true;
	shadow.className = 'vml_box_shadow';
	shadow.style.zIndex = element.zIndex - 1;
	shadow.style.filter = 'progid:DXImageTransform.Microsoft.Blur(pixelRadius='+ shadow.userAttrs.radius +',makeShadow=true,shadowOpacity='+ element.opacity +')';

	element.parentNode.appendChild(shadow);
	//element.parentNode.insertBefore(shadow, element.element);

	// For window resizing
	element.vml.push(shadow);

	return(true);
}

function createBorderRect(element, vml_parent) {
	if (isNaN(element.borderRadius)) { return(false); }

	element.style.background = 'transparent';
	element.style.borderColor = 'transparent';

	var rect = document.createElement('v:roundrect');
	rect.position_offset = {
		'y': (0.5 * element.strokeWeight) - vml_parent.pos_ieCSS3.y,
		'x': (0.5 * element.strokeWeight) - vml_parent.pos_ieCSS3.x
	};
	rect.size_offset = {
		'width': 0 - element.strokeWeight,
		'height': 0 - element.strokeWeight
	};
	rect.arcsize = element.arcSize +'px';
	rect.strokeColor = element.strokeColor;
	rect.strokeWeight = element.strokeWeight +'px';
	rect.stroked = element.stroked;
	rect.className = 'vml_border_radius';
	rect.style.display = 'block';
	rect.style.position = 'absolute';
	rect.style.top = (element.pos_ieCSS3.y + rect.position_offset.y) +'px';
	rect.style.left = (element.pos_ieCSS3.x + rect.position_offset.x) +'px';
	rect.style.width = (element.offsetWidth + rect.size_offset.width) +'px';
	rect.style.height = (element.offsetHeight + rect.size_offset.height) +'px';
	rect.style.antialias = true;
	rect.style.zIndex = element.zIndex - 1;

	if (border_opacity &#038;&#038; (element.opacity < 1)) { 		rect.style.filter = 'progid:DXImageTransform.Microsoft.Alpha(Opacity='+ parseFloat(element.opacity * 100) +')'; 	} 	var fill = document.createElement('v:fill'); 	fill.color = element.fillColor; 	fill.src = element.fillSrc; 	fill.className = 'vml_border_radius_fill'; 	fill.type = 'tile'; 	fill.opacity = element.opacity; 	// Hack: IE6 doesn't support transparent borders, use padding to offset original element 	isIE6 = /msie|MSIE 6/.test(navigator.userAgent); 	if (isIE6 &#038;&#038; (element.strokeWeight > 0)) {
		element.style.borderStyle = 'none';
		element.style.paddingTop = parseInt(element.currentStyle.paddingTop || 0) + element.strokeWeight;
		element.style.paddingBottom = parseInt(element.currentStyle.paddingBottom || 0) + element.strokeWeight;
	}

	rect.appendChild(fill);
	element.parentNode.appendChild(rect);
	//element.parentNode.insertBefore(rect, element.element);

	// For window resizing
	element.vml.push(rect);

	return(true);
}

function createTextShadow(element, vml_parent) {
	if (!element.textShadow) { return(false); }

	var match = element.textShadow.match(/^(\d+)px (\d+)px (\d+)px (#?\w+)/);
	if (!match) { return(false); }

	//var shadow = document.createElement('span');
	var shadow = element.cloneNode(true);
	var radius = parseInt(RegExp.$3 || 0);
	shadow.userAttrs = {
		'x': parseInt(RegExp.$1 || 0) - (radius),
		'y': parseInt(RegExp.$2 || 0) - (radius),
		'radius': radius / 2,
		'color': (RegExp.$4 || '#000')
	};
	shadow.position_offset = {
		'y': (0 - vml_parent.pos_ieCSS3.y + shadow.userAttrs.y),
		'x': (0 - vml_parent.pos_ieCSS3.x + shadow.userAttrs.x)
	};
	shadow.size_offset = {
		'width': 0,
		'height': 0
	};
	shadow.style.color = shadow.userAttrs.color;
	shadow.style.position = 'absolute';
	shadow.style.top = (element.pos_ieCSS3.y + shadow.position_offset.y) +'px';
	shadow.style.left = (element.pos_ieCSS3.x + shadow.position_offset.x) +'px';
	shadow.style.antialias = true;
	shadow.style.behavior = null;
	shadow.className = 'ieCSS3_text_shadow';
	shadow.innerHTML = element.innerHTML;
	// For some reason it only looks right with opacity at 75%
	shadow.style.filter = '\
		progid:DXImageTransform.Microsoft.Alpha(Opacity=75)\
		progid:DXImageTransform.Microsoft.Blur(pixelRadius='+ shadow.userAttrs.radius +',makeShadow=false,shadowOpacity=100)\
	';

	var clone = element.cloneNode(true);
	clone.position_offset = {
		'y': (0 - vml_parent.pos_ieCSS3.y),
		'x': (0 - vml_parent.pos_ieCSS3.x)
	};
	clone.size_offset = {
		'width': 0,
		'height': 0
	};
	clone.style.behavior = null;
	clone.style.position = 'absolute';
	clone.style.top = (element.pos_ieCSS3.y + clone.position_offset.y) +'px';
	clone.style.left = (element.pos_ieCSS3.x + clone.position_offset.x) +'px';
	clone.className = 'ieCSS3_text_shadow';

	element.parentNode.appendChild(shadow);
	element.parentNode.appendChild(clone);

	element.style.visibility = 'hidden';

	// For window resizing
	element.vml.push(clone);
	element.vml.push(shadow);

	return(true);
}

function ondocumentready(classID) {
	if (!supportsVml()) { return(false); }

  if (this.className.match(classID)) { return(false); }
	this.className = this.className.concat(' ', classID);

	// Add a namespace for VML (IE8 requires it)
	if (!document.namespaces.v) { document.namespaces.add("v", "urn:schemas-microsoft-com:vml"); }

	// Check to see if we've run once before on this page
	if (typeof(window.ieCSS3) == 'undefined') {
		// Create global ieCSS3 object
		window.ieCSS3 = {
			'vmlified_elements': new Array(),
			'update_timer': setInterval(updatePositionAndSize, timer_length)
		};

		if (typeof(window.onresize) == 'function') { window.ieCSS3.previous_onresize = window.onresize; }

		// Attach window resize event
		window.onresize = updatePositionAndSize;
	}

	// These attrs are for the script and have no meaning to the browser:
	this.borderRadius = parseInt(this.currentStyle['iecss3-border-radius'] ||
	                             this.currentStyle['-moz-border-radius'] ||
	                             this.currentStyle['-webkit-border-radius'] ||
	                             this.currentStyle['border-radius'] ||
	                             this.currentStyle['-khtml-border-radius']);
	this.arcSize = Math.min(this.borderRadius / Math.min(this.offsetWidth, this.offsetHeight), 1);
	this.fillColor = this.currentStyle.backgroundColor;
	this.fillSrc = this.currentStyle.backgroundImage.replace(/^url\("(.+)"\)$/, '$1');
	this.strokeColor = this.currentStyle.borderColor;
	this.strokeWeight = parseInt(this.currentStyle.borderWidth);
	this.stroked = 'true';
	if (isNaN(this.strokeWeight) || (this.strokeWeight == 0)) {
		this.strokeWeight = 0;
		this.strokeColor = fillColor;
		this.stroked = 'false';
	}
	this.opacity = parseFloat(this.currentStyle.opacity || 1);
	this.textShadow = this.currentStyle['text-shadow'];

	this.element.vml = new Array();
	this.zIndex = parseInt(this.currentStyle.zIndex);
	if (isNaN(this.zIndex)) { this.zIndex = 0; }

	// Find which element provides position:relative for the target element (default to BODY)
	vml_parent = this;
	var limit = 100, i = 0;
	do {
		vml_parent = vml_parent.parentElement;
		i++;
		if (i >= limit) { return(false); }
	} while ((typeof(vml_parent) != 'undefined') &#038;&#038; (vml_parent.currentStyle.position != 'relative') &#038;&#038; (vml_parent.tagName != 'BODY'));

	vml_parent.pos_ieCSS3 = findPos(vml_parent);
	this.pos_ieCSS3 = findPos(this);

	var rv1 = createBoxShadow(this, vml_parent);
	var rv2 = createBorderRect(this, vml_parent);
	var rv3 = createTextShadow(this, vml_parent);
	if (rv1 || rv2 || rv3) { window.ieCSS3.vmlified_elements.push(this.element); }

	if (typeof(vml_parent.document.ieCSS3_stylesheet) == 'undefined') {
		vml_parent.document.ieCSS3_stylesheet = vml_parent.document.createStyleSheet();
		vml_parent.document.ieCSS3_stylesheet.addRule("v\\:roundrect", "behavior: url(#default#VML)");
		vml_parent.document.ieCSS3_stylesheet.addRule("v\\:fill", "behavior: url(#default#VML)");
		// Compatibility with IE7.js
		vml_parent.document.ieCSS3_stylesheet.ie7 = true;
	}
}

function updatePositionAndSize() {
	if (typeof(window.ieCSS3.vmlified_elements) != 'object') { return(false); }

	for (var i in window.ieCSS3.vmlified_elements) {
		var el = window.ieCSS3.vmlified_elements[i];

		if (typeof(el.vml) != 'object') { continue; }

		for (var z in el.vml) {
			//var parent_pos = findPos(el.vml[z].parentNode);
			var new_pos = findPos(el);
			new_pos.x = (new_pos.x + el.vml[z].position_offset.x) + 'px';
			new_pos.y = (new_pos.y + el.vml[z].position_offset.y) + 'px';
			if (el.vml[z].style.left != new_pos.x) { el.vml[z].style.left = new_pos.x; }
			if (el.vml[z].style.top != new_pos.y) { el.vml[z].style.top = new_pos.y; }

			var new_size = {
				'width': parseInt(el.offsetWidth + el.vml[z].size_offset.width),
				'height': parseInt(el.offsetHeight + el.vml[z].size_offset.height)
			}
			if (el.vml[z].offsetWidth != new_size.width) { el.vml[z].style.width = new_size.width +'px'; }
			if (el.vml[z].offsetHeight != new_size.height) { el.vml[z].style.height = new_size.height +'px'; }
		}
	}

	if (event &#038;&#038; (event.type == 'resize') &#038;&#038; typeof(window.ieCSS3.previous_onresize) == 'function') { window.ieCSS3.previous_onresize(); }
}
// ]]&gt;</script></pre>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>https://www.fushanlang.com/css3-rounded-property-firefox-chrome-safaris-implementation-1889/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>IE下css样式控制</title>
		<link>https://www.fushanlang.com/css-style-control-under-ie-1532/</link>
		<comments>https://www.fushanlang.com/css-style-control-under-ie-1532/#comments</comments>
		<pubDate>Mon, 27 Dec 2010 06:36:56 +0000</pubDate>
		<dc:creator><![CDATA[fushanlang]]></dc:creator>
				<category><![CDATA[css]]></category>
		<category><![CDATA[IE]]></category>

		<guid isPermaLink="false">http://www.fushanlang.com/blog/?p=1532</guid>
		<description><![CDATA[<p>做网站的前台程序员应该都吃过不同浏览器下css样式差别的苦头，尤其是IE6，总是带给我们无尽的回忆。:)</p> <p>今天在这片日志里想稍微总结一下IE下样式控制应该注意的几点。</p> 1. CSS HACK IE6，IE7,IE8 对css样式属性的接受程度为: ———————IE6——    IE7——IE8--NoneIE &#62;property——    Y——    Y——    Y——    N—— .property——    Y——    Y——    Y——    N—— *property——    Y——    Y——    Y——    N—— _property——    Y——    N——    N——  N—— 同时IE6不支持!important. 其实主要是浏览器：IE6/IE7/firefox下，各个对CSS代码的解释有区别，下边转载一篇HACK的文章，相当实用。 区别IE6与FF：           background:orange;*background:blue; 区别IE6与IE7：          background:green !important;background:blue; 区别IE7与FF：           background:orange; *background:green; 区别FF/IE7/IE6：       background:orange;*background:green !important;*background:blue; 注：IE都能识别*标准浏览器(如FF)不能识别* IE6能识别*，但不能识别 !important IE7能识别*，也能识别!important FF不能识别*，但能识别!important 另外再补充一个，下划线"_", IE6支持下划线，IE7和firefox均不支持下划线。所以针对IE6采用下划线属性也是一个常用方法。 于是大家还可以这样来区分IE6、IE7、firefox : background:orange;*background:green;_background:blue; <p></p> * html  p {color:#f00;}            支持 IE6        不支持FF IE7 IE8b *+html p {color:#f00;}        <span style="color:#777"> . . . &#8594; Read More: <a href="https://www.fushanlang.com/css-style-control-under-ie-1532/">IE下css样式控制</a></span>]]></description>
				<content:encoded><![CDATA[<p>做网站的前台程序员应该都吃过不同浏览器下css样式差别的苦头，尤其是IE6，总是带给我们无尽的回忆。:)</p>
<p>今天在这片日志里想稍微总结一下IE下样式控制应该注意的几点。</p>
<h3><strong>1. CSS HACK</strong></h3>
<pre>IE6，IE7,IE8 对css样式<strong>属性</strong>的接受程度为:

———————IE6——    IE7——IE8--NoneIE
&gt;property——    Y——    Y——    Y——    N——
.property——    Y——    Y——    Y——    N——
*property——    Y——    Y——    Y——    N——
_property——    Y——    N——    N——  N——

同时IE6不支持!important.

其实主要是浏览器：IE6/IE7/firefox下，各个对CSS代码的解释有区别，下边转载一篇HACK的文章，相当实用。

区别IE6与FF：           background:orange;*background:blue;

区别IE6与IE7：          background:green <strong>!important</strong>;background:blue;

区别IE7与FF：           background:orange; <strong>*</strong>background:green;

区别FF/IE7/IE6：       background:orange;<strong>*</strong>background:green <strong>!important</strong>;<strong>*</strong>background:blue;

注：IE都能识别*标准浏览器(如FF)不能识别*
IE6能识别*，但不能识别 !important
IE7能识别*，也能识别!important
FF不能识别*，但能识别!important

另外再补充一个，下划线"_",
IE6支持下划线，IE7和firefox均不支持下划线。所以针对IE6采用下划线属性也是一个常用方法。<span id="more-1532"></span>

于是大家还可以这样来区分IE6、IE7、firefox
: background:orange;*background:green;_background:blue;</pre>
<p><img src="http://www.fushanlang.com/blog/wp-content/uploads/auto_save_image/2010/12/195051OQr.jpg" border="0" alt="" /></p>
<pre>* html  p {color:#f00;}            支持 IE6        不支持FF IE7 IE8b

*+html p {color:#f00;}            支持 IE7 IE8b        不支持FF IE6

p {*color:#f00;}            支持 IE7 IE6        不支持FF IE8

注：不管是什么方法，书写的顺序都是firefox的写在前面，IE7的写在中间，IE6的写在后面。</pre>
<h3>2.兼容性技巧</h3>
<p><span style="font-family: 宋体;"><strong>清除浮动：</strong>将以下代码加入Global CSS 中,给需要闭合的div加上 即可,屡试不爽.<br />
&lt;style&gt;<br />
/* Clear Fix */</span></p>
<p><span style="font-family: 宋体;">.clearfix:after<br />
{<br />
content:&#8221;.&#8221;;<br />
display:block;<br />
height:0;<br />
clear:both;<br />
visibility:hidden;<br />
}<br />
.clearfix<br />
{<br />
display:inline-block;<br />
}<br />
/* Hide from IE Mac */<br />
.clearfix {display:block;}<br />
/* End hide from IE Mac */<br />
/* end of clearfix */<br />
&lt;/style&gt;</span></p>
<p>1, FF下给 div 设置<strong> padding 后会导致 width 和 height </strong>增加, 但IE不会.(可用!important解决)<br />
2.<strong>垂直居中</strong>.将 line-height 设置为 当前 div 相同的高度, 再通过 vertical-align: middle.( 注意内容不要换行.)<br />
3.<strong>水平居中</strong>. margin: 0 auto;(当然不是万能)<br />
4.若需给<strong> a 标签内内容加上 样式, 需要设置 display: block;</strong>(常见于导航标签)<br />
5. FF 和 IE 对 BOX 理解的差异导致相差 2px 的还有设为 <strong>float的div在ie下 m问</strong><strong><span style="font-family: 宋体;">argin加倍等</span></strong><span style="font-family: 宋体;"><strong>题</strong>.<br />
6. ul 标签在 FF 下面默认有 list-style 和 padding . 最好事先声明, 以避免不必要的麻烦. (常见于导航标签和内容列表)<br />
7. <strong>作为外部 wrapper 的 div 不要定死高度, 最好还加上 overflow: hidden.</strong>以达到高度自适应.</span></p>
<h3><span style="font-family: 宋体;">3.<strong>IE6特别处理</strong></span></h3>
<p><span style="font-family: 宋体;">IE6并不支持CSS2，很多hover伪类只能用在标签A上，所以，为了让某些常用类或标签也能用上hover样式改变的效果，需要配合javascript，对绑定的元素进行手动控制。常见的有直接通过jQuery类库的css选择器</span></p>
<p><span style="font-family: 宋体;">$(&#8216;css selector&#8217;).hover(function(){$(this).toggleClass(&#8216;hover类名&#8217;);},</span><span style="font-family: 宋体;">function(){$(this).toggleClass(&#8216;hover类名&#8217;);}</span><span style="font-family: 宋体;">);</span></p>
<p><span style="font-family: 宋体;">IE6默认的标签有些有默认的margin，padding，所以为了保持多个浏览器下一致性，建议在css样式开头将大部分标签的margin：0px，padding：0px，进行清零处理。</span></p>
<p><span style="font-family: 宋体;"><strong>例如Form标签，在IE6下默认是有margin的。另外IE6不支持png样式透明的问题，大都可以通过javascript来处理，常用的有“</strong></span>DD_belatedPNG_0.0.8a.js<span style="font-family: 宋体;"><strong>”，操作比较简单，只需要为制定的css 选择器fix一下就可以了。</strong></span></p>
<h3><span style="font-family: 宋体;"><strong>4.IE only语法</strong></span></h3>
<p><span style="font-family: 宋体;"><strong><br />
</strong></span></p>
]]></content:encoded>
			<wfw:commentRss>https://www.fushanlang.com/css-style-control-under-ie-1532/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>css class Id不解</title>
		<link>https://www.fushanlang.com/css-class-id-understand-1409/</link>
		<comments>https://www.fushanlang.com/css-class-id-understand-1409/#comments</comments>
		<pubDate>Thu, 25 Nov 2010 01:03:22 +0000</pubDate>
		<dc:creator><![CDATA[fushanlang]]></dc:creator>
				<category><![CDATA[css]]></category>

		<guid isPermaLink="false">http://www.fushanlang.com/blog/?p=1409</guid>
		<description><![CDATA[<p>前天调整一个页面的css，发现一个奇怪的事情，布局里div的css属性margin-bottom在其他浏览器里很好使，布局正常，在IE7里浏览却有得起作用，有得不起作用，很尴尬。于是试着将css class 变成 Id属性，这下IE下突然又好用了，很是不解。</p> <p>平常来说，class可以使用多次，Id一般只用一次，便于与javascript唯一性操作。但平时同事处理的css里总是看到Id重复使用的问题，没有看到影响布局的问题，虽然不太标准，但浏览器基本都支持。但是还是没有搞清楚IE浏览器下的怪事。:(</p> ]]></description>
				<content:encoded><![CDATA[<p>前天调整一个页面的css，发现一个奇怪的事情，布局里div的css属性margin-bottom在其他浏览器里很好使，布局正常，在IE7里浏览却有得起作用，有得不起作用，很尴尬。于是试着将css class 变成 Id属性，这下IE下突然又好用了，很是不解。</p>
<p>平常来说，class可以使用多次，Id一般只用一次，便于与javascript唯一性操作。但平时同事处理的css里总是看到Id重复使用的问题，没有看到影响布局的问题，虽然不太标准，但浏览器基本都支持。但是还是没有搞清楚IE浏览器下的怪事。:(</p>
]]></content:encoded>
			<wfw:commentRss>https://www.fushanlang.com/css-class-id-understand-1409/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
