<?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>蓝色的华 &#187; css</title>
	<atom:link href="http://bluehua.org/tag/css/feed" rel="self" type="application/rss+xml" />
	<link>http://bluehua.org</link>
	<description>分享所学,backup一切~</description>
	<lastBuildDate>Wed, 23 Nov 2011 08:43:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>纯sed压缩css文件</title>
		<link>http://bluehua.org/2009/12/01/701.html</link>
		<comments>http://bluehua.org/2009/12/01/701.html#comments</comments>
		<pubDate>Tue, 01 Dec 2009 12:20:34 +0000</pubDate>
		<dc:creator>冥王星2011</dc:creator>
				<category><![CDATA[web dev]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[sed]]></category>
		<category><![CDATA[shell]]></category>

		<guid isPermaLink="false">http://bluehua.org/?p=701</guid>
		<description><![CDATA[额,如果不考虑用java,还是可以考虑考虑这个&#8230; #!/bin/sh #&#34;^M&#34;用来代替显示win下的换行符,直接复制这段脚本是不能用滴 cat $1 &#124; sed -e 's/^M//g;s/^\xef\xbb\xbf//g;s/\([^0-9]\)0p[xt]/\10/g' -e 's/\/\*.*\*\///g' &#124; sed -e '/^[\t ]*\/\*/,/\*\/[\t ]*$/d' &#124; sed -e '/^[\t ]*$/d' -e 's/^[\t ]*//g' -e 's/;[\t ]*/;/g' -e 's/}[\t ]*/}/g' -e 's/\([^,\{;\}]\)$/\1;/g' -e 's/};/}/g' &#124; sed -e :a -e '/[,;{][\t ]*$/{N;s/\n/ /;ba}' &#62; /tmp/lala_css mv /tmp/lala_css $1 压缩规则较简单.. 删除注释 删除不必要的空白 删除window的utf BOM标记,删除win下的换行符 每条规则压成一行 0px [...]]]></description>
			<content:encoded><![CDATA[<p>额,如果不考虑用java,还是可以考虑考虑这个&#8230;</p>

<div class="wp_syntax"><div class="code overflow"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/sh</span>
<span style="color: #666666; font-style: italic;">#&quot;^M&quot;用来代替显示win下的换行符,直接复制这段脚本是不能用滴</span>
<span style="color: #c20cb9; font-weight: bold;">cat</span> $<span style="color: #000000;">1</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'s/^M//g;s/^\xef\xbb\xbf//g;s/\([^0-9]\)0p[xt]/\10/g'</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'s/\/\*.*\*\///g'</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'/^[\t ]*\/\*/,/\*\/[\t ]*$/d'</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'/^[\t ]*$/d'</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'s/^[\t ]*//g'</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'s/;[\t ]*/;/g'</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'s/}[\t ]*/}/g'</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'s/\([^,\{;\}]\)$/\1;/g'</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'s/};/}/g'</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-e</span> :a <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'/[,;{][\t ]*$/{N;s/\n/ /;ba}'</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>lala_css
<span style="color: #c20cb9; font-weight: bold;">mv</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>lala_css $<span style="color: #000000;">1</span></pre></div></div>

<p>压缩规则较简单..</p>
<ul>
<li>删除注释</li>
<li>删除不必要的空白</li>
<li>删除window的utf BOM标记,删除win下的换行符</li>
<li>每条规则压成一行</li>
<li>0px -&gt; 0</li>
</ul>
<p>压缩效果如下,比yuicompressor差一点:</p>
<pre> 72344 2009-12-01 19:57 layout.css
 69626 2009-12-01 19:52 layout-mini-sed.css
 68720 2009-12-01 19:56 layout-mini-yui.css</pre>
<p><a href="http://bluehua.org/wp-content/uploads/2009/12/compress-css.zip">文件下载点这里:compress-css.zip</a></p>
]]></content:encoded>
			<wfw:commentRss>http://bluehua.org/2009/12/01/701.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>ie6下filter造成图片出现白点</title>
		<link>http://bluehua.org/2009/03/16/245.html</link>
		<comments>http://bluehua.org/2009/03/16/245.html#comments</comments>
		<pubDate>Mon, 16 Mar 2009 06:29:22 +0000</pubDate>
		<dc:creator>冥王星2011</dc:creator>
				<category><![CDATA[web dev]]></category>
		<category><![CDATA[css]]></category>

		<guid isPermaLink="false">http://bluehua.org/?p=245</guid>
		<description><![CDATA[&#60;html&#62; 正常的图片&#60;br /&#62; &#60;img src=&#34;http://lh3.ggpht.com/_l8FcMjS-xnI/Sb3wh8kSk6I/AAAAAAAAExc/DMUyic7Odas/screenshot_003.jpg&#34; /&#62; &#60;br /&#62; 添加透明之后&#60;br /&#62; &#60;img style=&#34;filter:alpha(opacity=100);&#34; src=&#34;http://lh3.ggpht.com/_l8FcMjS-xnI/Sb3wh8kSk6I/AAAAAAAAExc/DMUyic7Odas/screenshot_003.jpg&#34; /&#62; &#60;/html&#62;]]></description>
			<content:encoded><![CDATA[
<div class="wp_syntax"><div class="code overflow"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>html<span style="color: #339933;">&gt;</span>
正常的图片<span style="color: #339933;">&lt;</span>br <span style="color: #339933;">/&gt;</span>
<span style="color: #339933;">&lt;</span>img src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;http://lh3.ggpht.com/_l8FcMjS-xnI/Sb3wh8kSk6I/AAAAAAAAExc/DMUyic7Odas/screenshot_003.jpg&quot;</span> <span style="color: #339933;">/&gt;</span> <span style="color: #339933;">&lt;</span>br <span style="color: #339933;">/&gt;</span>
添加透明之后<span style="color: #339933;">&lt;</span>br <span style="color: #339933;">/&gt;</span>
<span style="color: #339933;">&lt;</span>img style<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;filter:alpha(opacity=100);&quot;</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;http://lh3.ggpht.com/_l8FcMjS-xnI/Sb3wh8kSk6I/AAAAAAAAExc/DMUyic7Odas/screenshot_003.jpg&quot;</span>  <span style="color: #339933;">/&gt;</span>
<span style="color: #339933;">&lt;/</span>html<span style="color: #339933;">&gt;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://bluehua.org/2009/03/16/245.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>shell:创建单独的样式hack文件</title>
		<link>http://bluehua.org/2009/03/07/209.html</link>
		<comments>http://bluehua.org/2009/03/07/209.html#comments</comments>
		<pubDate>Sat, 07 Mar 2009 10:23:07 +0000</pubDate>
		<dc:creator>冥王星2011</dc:creator>
				<category><![CDATA[other]]></category>
		<category><![CDATA[web dev]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[shell]]></category>

		<guid isPermaLink="false">http://bluehua.org/?p=209</guid>
		<description><![CDATA[不管怎么说，通过”&#60;!&#8211;[if lte IE 6]&#62;”的形式单独加载patch文件是一种不错的做法，用ff的用户不用为这些为ie而做的恶心patch浪费流量，页面的渲染速度也许会有所提升。 下午靖威同学跟我说，可不可以写一个脚本可以提取样式表中的hack，生成单独的hack文件，这样可以大大减少单独维护hack文件的成本。感觉想法不错，难度也不是很大，参考了一下shell说明，写了几句，先备个忘，下周有时间测试一下。。 #!/bin/bash echo &#34;$1/csspro/&#34; find &#34;$1/csspro/&#34; -name *.css &#124; grep -v &#34;ie[67]&#34; &#62; /tmp/allcss.tmp cat /tmp/allcss.tmp &#124; xargs -i sed -i '/^$/d;s/\\{\\s/\\{/;s/\\;\\s/\\;/;s/\\s\\}/\\}/;s/\/\*.*\*\///;/^[\t ]*\/\*/,/\*\/[\t ]*$/d' &#123;&#125; cat /tmp/allcss.tmp &#124; xargs -i sed -n '/* *html/p' &#123;&#125; &#62;&#62; &#34;$1/csspro/patch/ie6.css&#34; cat /tmp/allcss.tmp &#124; xargs -i sed -n '/*+html/p' &#123;&#125; &#62;&#62; &#34;$1/csspro/patch/ie7.css&#34; cat /tmp/allcss.tmp &#124; [...]]]></description>
			<content:encoded><![CDATA[<p>不管怎么说，通过”&lt;!&#8211;[if lte IE 6]&gt;”的形式单独加载patch文件是一种不错的做法，用ff的用户不用为这些为ie而做的恶心patch浪费流量，页面的渲染速度也许会有所提升。</p>
<p>下午靖威同学跟我说，可不可以写一个脚本可以提取样式表中的hack，生成单独的hack文件，这样可以大大减少单独维护hack文件的成本。感觉想法不错，难度也不是很大，参考了一下shell说明，写了几句，先备个忘，下周有时间测试一下。。</p>

<div class="wp_syntax"><div class="code overflow"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;$1/csspro/&quot;</span>
<span style="color: #c20cb9; font-weight: bold;">find</span> <span style="color: #ff0000;">&quot;$1/csspro/&quot;</span> <span style="color: #660033;">-name</span> <span style="color: #000000; font-weight: bold;">*</span>.css <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #660033;">-v</span> <span style="color: #ff0000;">&quot;ie[67]&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>allcss.tmp
<span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>allcss.tmp <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">xargs</span> <span style="color: #660033;">-i</span> <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-i</span> <span style="color: #ff0000;">'/^$/d;s/\\{\\s/\\{/;s/\\;\\s/\\;/;s/\\s\\}/\\}/;s/\/\*.*\*\///;/^[\t ]*\/\*/,/\*\/[\t ]*$/d'</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #7a0874; font-weight: bold;">&#125;</span>
<span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>allcss.tmp <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">xargs</span> <span style="color: #660033;">-i</span> <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-n</span> <span style="color: #ff0000;">'/* *html/p'</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #7a0874; font-weight: bold;">&#125;</span>  <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #ff0000;">&quot;$1/csspro/patch/ie6.css&quot;</span>
<span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>allcss.tmp <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">xargs</span> <span style="color: #660033;">-i</span> <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-n</span> <span style="color: #ff0000;">'/*+html/p'</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #7a0874; font-weight: bold;">&#125;</span>  <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #ff0000;">&quot;$1/csspro/patch/ie7.css&quot;</span>
<span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>allcss.tmp <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">xargs</span> <span style="color: #660033;">-i</span> <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-i</span> <span style="color: #ff0000;">'/* *html/d;/*+html/d'</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #7a0874; font-weight: bold;">&#125;</span>
<span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>allcss.tmp</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://bluehua.org/2009/03/07/209.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IE下filter失效的问题</title>
		<link>http://bluehua.org/2008/08/25/35.html</link>
		<comments>http://bluehua.org/2008/08/25/35.html#comments</comments>
		<pubDate>Mon, 25 Aug 2008 03:26:30 +0000</pubDate>
		<dc:creator>冥王星2011</dc:creator>
				<category><![CDATA[web dev]]></category>
		<category><![CDATA[css]]></category>

		<guid isPermaLink="false">http://bluehua.org/?p=35</guid>
		<description><![CDATA[请在ie下测试一下代码 1 2 &#60;p style=&#34;width:auto;color:#FFF;background:#066;filter:alpha(opacity=50);&#34;&#62;使用 filter 透明度效果&#40;这个是不生效的&#41;&#60;/p&#62; &#60;p style=&#34;zoom:1;color:#FFF;background:#066;filter:alpha(opacity=50);&#34;&#62;使用 filter 透明度效果&#40;使用zoom使其拥有布局&#41;&#60;/p&#62;]]></description>
			<content:encoded><![CDATA[<p>请在ie下测试一下代码</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><div class="overflow"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>p style<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;width:auto;color:#FFF;background:#066;filter:alpha(opacity=50);&quot;</span><span style="color: #339933;">&gt;</span>使用 filter 透明度效果<span style="color: #009900;">&#40;</span>这个是不生效的<span style="color: #009900;">&#41;</span><span style="color: #339933;">&lt;/</span>p<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>p style<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;zoom:1;color:#FFF;background:#066;filter:alpha(opacity=50);&quot;</span><span style="color: #339933;">&gt;</span>使用 filter 透明度效果<span style="color: #009900;">&#40;</span>使用zoom使其拥有布局<span style="color: #009900;">&#41;</span><span style="color: #339933;">&lt;/</span>p<span style="color: #339933;">&gt;</span></pre></div</td></tr></table></div>

<p>原因是只有当元素的hasLayout为true时,filter才会生效,真贱~~<br />
参阅:<a href="http://audi.tw/Blog/CSS/css.zoom.filter.alpha.opacity.asp">http://audi.tw/Blog/CSS/css.zoom.filter.alpha.opacity.asp</a></p>
]]></content:encoded>
			<wfw:commentRss>http://bluehua.org/2008/08/25/35.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic page generated in 0.491 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2012-02-05 03:12:16 -->

