<?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>Lefter &#187; css</title>
	<atom:link href="http://lefter.net/blog/tag/css/feed/" rel="self" type="application/rss+xml" />
	<link>http://lefter.net/blog</link>
	<description>blog of lefter</description>
	<lastBuildDate>Mon, 23 Nov 2009 10:27:56 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>小窗口的的浏览体验</title>
		<link>http://lefter.net/blog/minify_view/</link>
		<comments>http://lefter.net/blog/minify_view/#comments</comments>
		<pubDate>Sat, 19 Sep 2009 03:58:56 +0000</pubDate>
		<dc:creator>lujo</dc:creator>
				<category><![CDATA[体验&交互&平面&策划]]></category>
		<category><![CDATA[前端开发&架构]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[ue]]></category>

		<guid isPermaLink="false">http://lefter.net/blog/?p=1026</guid>
		<description><![CDATA[小窗口的的浏览体验是必须的，在保证页面内容的完整性的前提下，满足多终端设备的访问，细小部分的处理更能体现一个企业的水准。出现小窗口浏览的情形有很多，比如和女朋友抢电脑用... ]]></description>
			<content:encoded><![CDATA[小窗口的的浏览体验是必须的，在保证页面内容的完整性的前提下，满足多终端设备的访问，细小部分的处理更能体现一个企业的水准。出现小窗口浏览的情形有很多，比如和女朋友抢电脑用的时候，女朋友要看电影，用户要看新闻，在难分高下的时候只能“AA”，因此浏览新闻就只能缩小窗口了：）
<br/><strong>看了一下国内网站（满屏自适应部分）基本上没有考虑这点</strong>
<img src="/blog/wp-content/uploads/2009/09/tenPay_full.gif" alt="tenPay_full" title="tenPay_full" />
<img src="/blog/wp-content/uploads/2009/09/tenPay_minify.gif" alt="tenPay_minify" title="tenPay_minify" />
<img src="/blog/wp-content/uploads/2009/09/baidu.gif" alt="baidu" title="baidu" />
<img src="/blog/wp-content/uploads/2009/09/baidu_full.gif" alt="baidu_full" title="baidu_full" />
<img src="/blog/wp-content/uploads/2009/09/taobao.gif" alt="taobao" title="taobao" />
<img src="/blog/wp-content/uploads/2009/09/qq.gif" alt="qq" title="qq"  />
<strong>再看Yahoo</strong>最上面的提示条满屏的时候是100%，占据整个宽度
<img src="/blog/wp-content/uploads/2009/09/yahoo.gif" alt="yahoo" title="yahoo" />
缩小的时候页面内容完整，布局没有错乱
<img src="/blog/wp-content/uploads/2009/09/yahoo_small.gif" alt="yahoo_small" title="yahoo_small" />
<p>对于块级元素,宽度默认会继承父级的宽度也就是100%（内联元素没有宽度，即使定义了也无效），而最外层元素HTML的宽度一般是随窗口的改变而改变的(改变窗口大小再点击下面代码)</p>
<pre><code>alert(document.body.offsetWidth + "px")</code></pre>
<p>YAHOO的做法是为满屏的元素（顶部提示条）加上min-width ,IE6不支持此属性不知道是YAHOO是怎么解决的，但是让IE6支持min-width实现方法可以用执行表达式 Expression:</p>
<pre><code>width:expression((documentElement.clientWidth &lt; 400) ? "400px" : "auto" )</code></pre>
<p>另一种方法是用border-width来模拟</p>
<pre><code>* html .minwidth { 
	border-left:600px solid #fff; float:left
}
* html .container { 
	margin-left:-600px; float:left;	 position:relative;
}</code></pre>
<p><strong><a href="/demo/ie6_min-width.htm">查看演示</a></strong></p>]]></content:encoded>
			<wfw:commentRss>http://lefter.net/blog/minify_view/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>用XBL实现FireFox连续字符自动换行</title>
		<link>http://lefter.net/blog/word-break_for_firefox/</link>
		<comments>http://lefter.net/blog/word-break_for_firefox/#comments</comments>
		<pubDate>Thu, 03 Sep 2009 10:03:26 +0000</pubDate>
		<dc:creator>lefter</dc:creator>
				<category><![CDATA[前端开发&架构]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[浏览器]]></category>

		<guid isPermaLink="false">http://lefter.net/blog/?p=973</guid>
		<description><![CDATA[一般来讲，在排版中,中文及一些亚洲国家的文字标点不会在每行的起始位置显示，一个完整的英文单词不会出现在两行中，因此当连续的文字过长是会破坏所在区域的布局；IE下有word-break和word... ]]></description>
			<content:encoded><![CDATA[<p>一般来讲，在排版中,中文及一些亚洲国家的文字标点不会在每行的起始位置显示，一个完整的英文单词不会出现在两行中，因此当连续的文字过长是会破坏所在区域的布局；IE下有<a href="http://www.w3.org/TR/css3-text/#word-wrap">word-break</a>和<a href="http://www.w3.org/TR/css3-text/#word-break">word-warp</a>来解决这个方法，但是Firefox不支持这两属性，用XBL能让Firefox达到相应的效果</p>
<p><a href="https://developer.mozilla.org/en/XBL">XBL</a>eXtensible Bindings Language也即是可扩展绑定语言,有点类似IE的HTC,HTC在CSS中的引用格式为：</p>
<pre><code>p{behavior:url(test.htc)}</code></pre>主要作用就是用来定义XUL组件的行为模式,XBL语法结构为：
<pre>
<code>&lt;?xml version="1.0"?>
&lt;bindings xmlns="http://www.mozilla.org/xbl">
  &lt;binding id="binding1">
    &lt;!-- content, property, method and event descriptions go here -->
  &lt;/binding>
  &lt;binding id="binding2">
    &lt;!-- content, property, method and event descriptions go here -->
  &lt;/binding>
&lt;/bindings>
</code>
</pre>
<p>
然后就可以通过Firefox的私有属性<a href="https://developer.mozilla.org/en/CSS/-moz-binding">-moz-binding</a> 将一个元素关联到一个XBL文件中的指定项上:</p>
<pre><code>p {
    -moz-binding:(url('lefter.net/demo/wordwrap.xml.xml#wordwrap');
}</code></pre>
<a href="/demo/FF_word_break.htm"><strong>Firefox演示效果</strong></a><br/>
<strong>推荐阅读</strong>
<ol>
<li><a href="https://developer.mozilla.org/en/CSS_Reference/Mozilla_Extensions">FireFox私有属性</a></li>
<li><a href="https://developer.mozilla.org/en/XBL">Firefox XBL</a></li>
<li><a href="http://blog.stchur.com/2007/02/22/emulating-css-word-wrap-for-mozillafirefox/">Emulating CSS word-wrap for Mozilla/Firefox</a></li>
<li><a href="http://www.hedgerwow.com/360/dhtml/css-word-break.html">Cross Browser Word Breaker</a></li>
<li><a href="http://dancewithnet.com/2008/12/04/word-break-all/">连续字体换行的解决方案</a></li>
</ol>
<ins datetime="2009-09-03T12:38:36+00:00">回家在自己的电脑上升级Firefox到Firefox/3.5.2，发现Firefox/3.5.2已经对word-breakz支持了，对text-shadow也已经支持了。</ins>]]></content:encoded>
			<wfw:commentRss>http://lefter.net/blog/word-break_for_firefox/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>两种解决IE6不支持固定定位的方法</title>
		<link>http://lefter.net/blog/ie6_position_fixed/</link>
		<comments>http://lefter.net/blog/ie6_position_fixed/#comments</comments>
		<pubDate>Wed, 02 Sep 2009 03:40:05 +0000</pubDate>
		<dc:creator>lujo</dc:creator>
				<category><![CDATA[前端开发&架构]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[浏览器]]></category>

		<guid isPermaLink="false">http://lefter.net/blog/?p=966</guid>
		<description><![CDATA[有两种让IE6支持position:fixed
1.用CSS执行表达式

*{margin:0;padding:0;}
* html,* html body{ 
	background-image:url(about:blank);
 	background-attachment:fixed;
}
* html .fixed{
    position:absolute;
    bottom:auto;
    top:expres... ]]></description>
			<content:encoded><![CDATA[<h4>有两种让IE6支持position:fixed</h4>
<h3>1.用CSS执行表达式</h3>
<pre>
<code>*{margin:0;padding:0;}
* html,* html body{ 
	background-image:url(about:blank);
 	background-attachment:fixed;
}
* html .fixed{
    position:absolute;
    bottom:auto;
    top:expression(eval(document.documentElement.scrollTop+
    document.documentElement.clientHeight-this.offsetHeight-
    (parseInt(this.currentStyle.marginTop,10)||0)-
    (parseInt(this.currentStyle.marginBottom,10)||0)));
}      
.fixed{
    position:fixed;
    bottom:0px;
    top:auto;
}   
</code>
</pre>
<a href="/demo/IE6position_fix.htm"><strong>查看演示</strong></a>
<h3>2.让body保持其原有高度，让html只有一个窗口那么高</h3>
<pre><code>*{margin:0;padding:0}
*html{overflow:hidden;}
*html body{height:100%;overflow:auto;}        
.fixed{
    position:fixed; _position:absolute;
    left:0;
    bottom:0;
}</code>
</pre>
<a href="/demo/IE6positionfixed_bug.htm"><strong>查看演示</strong></a>
<p><strong>推荐阅读</strong> <br/><a href="http://tagsoup.com/cookbook/css/fixed/">http://tagsoup.com/cookbook/css/fixed/</a><br/><a href="http://subtlegradient.com/articles/2009/07/29/css_position_fixed_for_ie6.html">http://subtlegradient.com/</a></p>]]></content:encoded>
			<wfw:commentRss>http://lefter.net/blog/ie6_position_fixed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>自动改变CSS，JS版本</title>
		<link>http://lefter.net/blog/automatically-version-your-css-and-javascript-files/</link>
		<comments>http://lefter.net/blog/automatically-version-your-css-and-javascript-files/#comments</comments>
		<pubDate>Sun, 09 Aug 2009 03:35:36 +0000</pubDate>
		<dc:creator>lujo</dc:creator>
				<category><![CDATA[前端开发&架构]]></category>
		<category><![CDATA[程序相关]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://lefter.net/blog/?p=759</guid>
		<description><![CDATA[在雅虎工程师，史蒂夫Souders 的高性能网站建设中，有很多条关于网站性能优化的建议,其中第3条建议您使用树立了一个Expires头的静态文件（图片， CSS和JavaScript ），实施Expires头很简单，在您... ]]></description>
			<content:encoded><![CDATA[在雅虎工程师，史蒂夫Souders 的<a href="http://oreilly.com/catalog/9780596529307/">高性能网站建设</a>中，有很多条关于网站性能优化的<a href="http://developer.yahoo.com/performance/rules.html">建议</a>,其中<a href="http://developer.yahoo.com/performance/rules.html#expires">第3条建议</a>您使用树立了一个Expires头的静态文件（图片， CSS和JavaScript ），实施Expires头很简单，在您的<a href="http://www.freewebmasterhelp.com/tutorials/htaccess/1" title="Apache非常强大的分布式配置文件">.htaccess</a>的文件，您可以使用下面的代码
<pre><code>#Far Future Expires Header
&lt;FilesMatch "\.(gif|png|jpg|js|css|swf)$"&gt;
    ExpiresActive On
    ExpiresDefault "access plus 10 years"
&lt;/FilesMatch&gt;
</code>
</pre>
作者指出：<blockquote>Keep in mind, if you use a far future Expires header you have to change the component’s filename whenever the component changes. At Yahoo! we often make this step part of the build process: a version number is embedded in the component’s filename, for example, yahoo_2.0.6.js.</blockquote>
要生成像yahoo_2.0.6.js可以按照下面的方法：
<p>第一步，建立一些可规则重写的存储模块，一边存储文件的版本号，因此还是在.htaccess的文件中加入下面的代码</P><pre><code>#Rules for Versioned Static Files
RewriteRule ^(scripts|css)/(.+)\.(.+)\.(js|css)$ $1/$2.$4 [L]
</code></pre>
<p>然后写一个PHP函数来检查文件的最后修改日期，然后将服务器的修改时间作为版本号</p>
<pre><code>&lt;?php 
function autoVer($url){$path = pathinfo($url); 
$ver = '.'.filemtime($_SERVER['DOCUMENT_ROOT'].$url).'.';
echo $path['dirname'].'/'.str_replace('.', $ver, $path['basename']); } 
?&gt; 
</code></pre>
然后我们可以将这个函数包含到页面中
<pre><code>include($_SERVER['DOCUMENT_ROOT'].'/path/to/autoVer.php'); 
&lt;link rel="stylesheet" href="&lt;?php autoVer('/css/structure.css'); ?&gt;" 
type="text/css" /&gt; 
&lt;script type="text/javascript" src="&lt;?php autoVer('/scripts/prototype.js'); ?&gt;"&gt;
&lt;/script&gt; :include($_SERVER['DOCUMENT_ROOT'].'/path/to/autoVer.php'); 
&lt;link rel="stylesheet" href="&lt;?php autoVer('/css/structure.css'); ?&gt;"
type="text/css" /&gt;
&lt;script type="text/javascript" src="&lt;?php autoVer('/scripts/prototype.js'); ?&gt;"&gt;
&lt;/script&gt; 
</code></pre>
然后经过解析之后在页面文件看到的HTML代码将会是
<pre><code>&lt;script type="text/javascript" src="/prototype.197993206.js">&lt;/script&gt; 
</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://lefter.net/blog/automatically-version-your-css-and-javascript-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>META,http-equiv,name</title>
		<link>http://lefter.net/blog/meta/</link>
		<comments>http://lefter.net/blog/meta/#comments</comments>
		<pubDate>Sun, 21 Jun 2009 04:19:13 +0000</pubDate>
		<dc:creator>lujo</dc:creator>
				<category><![CDATA[前端开发&架构]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[html]]></category>

		<guid isPermaLink="false">http://lefter.net/blog/?p=694</guid>
		<description><![CDATA[今天在上看一个positioniseverything查看IE6的border混乱的BUG说明页面发现Firefox的滚动条有点不一样，心想难道Firefox也可以像IE一样控制其滚动条的颜色之内的了么？于是研究了一下原来是这段代码... ]]></description>
			<content:encoded><![CDATA[<p>今天在上看一个<a href="http://www.positioniseverything.net/">positioniseverything</a>查看<a href="http://www.positioniseverything.net/explorer/border-chaos.html">IE6的border混乱的BUG说明页面</a>发现Firefox的滚动条有点不一样，心想难道Firefox也可以像IE一样控制其滚动条的颜色之内的了么？于是研究了一下原来是这段代码的作用<code>&lt;meta http-equiv="MSThemeCompatible" content="yes"/&gt;</code>其作用是：是否在浏览器中中关闭操作系统的的主题用法，比如按钮样式，选择菜单的样式等，一般和WINDOW经典主题一致</p>
<p>BTW : 用IE私有属性能控制滚动条的样比如：scrollbar-3dlight-color,scrollbar-highlight-color，scrollbar-face-color，scrollbar-arrow-color，scrollbar-shadow-color，scrollbar-darkshadow-color，scrollbar-base-color，scrollbar-track-color</p>
<p>在此对常用的META标签的属性进行一些总结，</p>
<h4>HTTP-EQUIV</h4>
<p>HTTP-EQUIV类似于HTTP的头部协议，它回应给浏览器一些有用的信息，以帮助正确和精确地显</p>
<dl>
<dt>Refresh (刷新)</dt>
<dd>让网页多长时间（秒）刷新自己，或在多长时间后让网页自动跳转到其它网页<code>&lt;Meta http-equiv="Refresh" Content="5; Url=http://lefter.net"/&gt;</code></dd>
<dt>Expires (期限)</dt>
<dd>指定网页在缓存中的过期时间，一旦网页过期，必须重发请求到服务器获取更新<code>&lt;Meta http-equiv="Expires" Content="Wed, 26 Feb 1997 08:21:57 GMT"/&gt;</code></dd>
<dt>Pragma (cach模式)</dt>
<dd>禁止浏览器从本地机的缓存中调阅页面内容<code>&lt;Meta http-equiv="Pragma " Content="No-cach"/&gt;</code></dd>
<dt>X-UA-Compatible</dt>
<dd>X-UA-Compatible是针对ie8新加的一个设置，对于ie8之外的浏览器是不识别的，这个区别与content=&#8221;IE=7&#8243;在无论页面是否包含指令，都像是使用了 Windows Internet Explorer 7的标准模式。而content=&#8221;IE=EmulateIE7&#8243;模式遵循指令。对于多数网站来说，它是首选的兼容性模式。<code>&lt;Meta http-equiv="X-UA-Compatible " Content="IE=7"/&gt;</code></dd>
</dl>
<h4>NAME变量</h4>
<p>name是描述网页的，对应于Content网页内容，以便于搜索引擎机器人查找、分类，目前几乎所有的搜索引擎都使用网上机器人自动查找meta值来给网页分类。name的value值name=&#8221;"；指定所提供信息的类型。有些值是已经定义好的。</p>
<p>例如description，keyword，Author，Copyright等，这些常见的就不特地说明了</p>
<dl>
<dt>name=&#8221;Robots&#8221; (搜索引擎向导)</dt>
<dd>说明：Robots用来告诉搜索机器人哪些页面需要索引，哪些页面不需要索引。Content的参数有all、none、index、noindex、follow、nofollow。默认是all。index针对，页面文件本身，而Follow针对页面的链接，搜索引擎顺着连接往下抓取</dd>
</dl>
]]></content:encoded>
			<wfw:commentRss>http://lefter.net/blog/meta/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>新闻网被人攻击啦</title>
		<link>http://lefter.net/blog/someone-into-newscenter/</link>
		<comments>http://lefter.net/blog/someone-into-newscenter/#comments</comments>
		<pubDate>Fri, 19 Jun 2009 02:04:14 +0000</pubDate>
		<dc:creator>lujo</dc:creator>
				<category><![CDATA[前端开发&架构]]></category>
		<category><![CDATA[程序相关]]></category>
		<category><![CDATA[css]]></category>

		<guid isPermaLink="false">http://lefter.net/blog/?p=667</guid>
		<description><![CDATA[今天早上还在睡觉的时候，工作室同学打电话说新闻网不能访问了，我用Firefox能打开,但是用IE打开会报错XML 文档只能有一个顶层元素。处理资源'http://www.news.uestc.edu.cn/' 时出错。第 163 行，位... ]]></description>
			<content:encoded><![CDATA[<p>今天早上还在睡觉的时候，工作室同学打电话说新闻网不能访问了，我用Firefox能打开,但是用IE打开会报错<img  title="IE下报错" alt="IE下报错" src="http://lh6.ggpht.com/_M2p9f-QlWt4/SjrnoeMCKII/AAAAAAAABuA/GdCzYD0J-Qs/s640/%E6%9C%AA%E6%A0%87%E9%A2%98-1.jpg" /><code>XML 文档只能有一个顶层元素。处理资源'http://www.news.uestc.edu.cn/' 时出错。第 163 行，位置: 2<br />
< a href="http://devturkler.com" title="devturk">< font color="#FFFFFF" >turkler< /a ><br />
-^<br />
</code>我看怎么多出了一个链接，然后代开这个链接，好像能打开，我想知道是那个国家的人攻击的，想查一下其IP地址是那个国家的，但是PING不通，太强了 <ins datetime="2009-06-19T02:16:54+00:00">现在知道是土耳其人侵略了我们:)</ins></p>
<p>后来才注意到Firefox里面也是不正常的，因为下面多出了一行空白，因为他给链接用的白色的字体，背景也是白色的所以就不能看见；但是FIREFOX为什么不报错呢，我想是因为我们新闻网的前端架构采用XSL解析XML的方式,而XSL也是一种XML,XML相对html要规范的多,很多标签如CENTER，FONT等都被取消了,还有所有的标签必须关闭,而他用的<code>< a >< font color="#FFFFFF" >turkler< /a ></code>这两点都不满足，而Firefox渲染的时候是把XML直接转换为HTML(在IE，和firefox下分别查看源文件就可以知道)，因此不报错！但是能解析出来，只是此人用了白色的字体，而背景也是白色的，所以看不出来罢了，全选的时候就能看出来了<img alt="FIREFOX下面的效果" title="FIREFOX下面的效果" src="http://lh3.ggpht.com/_M2p9f-QlWt4/SjrnokIOpBI/AAAAAAAABuE/-vscosXBTpU/s640/%E6%9C%AA%E6%A0%87%E9%A2%98s-1.jpg"/></p>
<p>我滴神啦，被改掉的DEFAULT文件，还不知道有没有其他的文件被改掉<img alt="被改之后的文件" title="被改之后的文件"  src="http://lh6.ggpht.com/_M2p9f-QlWt4/SjrnooQVYkI/AAAAAAAABuI/7rv6GfDx2ck/s640/%E6%9C%AA%E5%91%BD%E5%90%8D.jpg" /></p>
<p>还好此人没有多少恶意，只是加上他的链接在上面，可能是想赚取PR，也给我们敲了个警钟。现在应该找出我们的服务器的漏洞出在哪里，大家不要在上面安装其他的软件</p>
]]></content:encoded>
			<wfw:commentRss>http://lefter.net/blog/someone-into-newscenter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>本博客重构时的随想-Performance</title>
		<link>http://lefter.net/blog/performanc/</link>
		<comments>http://lefter.net/blog/performanc/#comments</comments>
		<pubDate>Fri, 13 Mar 2009 04:19:34 +0000</pubDate>
		<dc:creator>lujo</dc:creator>
				<category><![CDATA[生活及其他]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[performance]]></category>

		<guid isPermaLink="false">http://ilujo.cn/?p=398</guid>
		<description><![CDATA[在进行本博客改版和重构的时候，手头正好有本《Hight Performance Web Site》,改书提到了一下的几个前端性能的优化方案

减少HTTP请求
使用内容发布网络（CDN）
增加EXPIRES头
压缩组建（gzp）
样式放... ]]></description>
			<content:encoded><![CDATA[<p>在进行本博客改版和重构的时候，手头正好有本《Hight Performance Web Site》,改书提到了一下的几个前端性能的优化方案</p>
<ul>
<li>减少HTTP请求</li>
<li>使用内容发布网络（CDN）</li>
<li>增加EXPIRES头</li>
<li>压缩组建（gzp）</li>
<li>样式放在首部</li>
<li>将脚本放在底部</li>
<li>避免CSS执行表达式</li>
<li>外联CSS，JS文件</li>
<li>避免重DNS定向</li>
<li>配置ETA</li>
</ul>
<p>该书开篇提到了一个性能黄金法则</p>
<blockquote><p>仅10%-20%的最终用户响应时间花在HTML文档上，其余时间时间用于下载页面的主键</p></blockquote>
<p>外联css这是没发说的，背景的图片也得到了合并；结合我的博客的结构-主页和博客页面独立，这样我就写了一个公共的style.css，一个blog.css,一个index.css,两个页面都调用style.css然后用@import分别在不同的页面引入blog.css。@import和LINK调用外部样式的区别之一就是，加载顺序的差别，一般来讲：link引用的CSS会同时被加载，而@import引用的CSS 会等到页面全部被下载完再被加载，这样就浏览@import加载CSS的页面时开始会没有样式</p>
<p>然后我去掉所有CSS中的IMAGES发现在整体布局，浏览体验上没的多大的区别，应此我就只是把带有背景图片的CSS样式抽取到单独的CSS文件中，然后@import，目的是让其最后加载！但是这样一来就增加了一个HTTP请求，出于这点我把带有背景图片的样式提取到最后脚本处，目的是让其最后执行！</p>
<p>虽然图片不多，体积也不很小，但是出于追求最优的角度，我思考了！</p>
<p>大多事物都是这样具有不确定性，很多时候，我们寻求的就是在特定条件下的最佳实践，因此我们更应该沉下心来去探原、整理、归纳、总结
<p><ins>在我实践之前才记得，在W3C标准中style定义一般是推荐放在BODY中的应此就没这样干，只是把CSS和图片，感觉加载速度还是不错</ins></p>
]]></content:encoded>
			<wfw:commentRss>http://lefter.net/blog/performanc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>浮动居中float:center</title>
		<link>http://lefter.net/blog/float-center/</link>
		<comments>http://lefter.net/blog/float-center/#comments</comments>
		<pubDate>Wed, 04 Mar 2009 09:36:43 +0000</pubDate>
		<dc:creator>lujo</dc:creator>
				<category><![CDATA[前端开发&架构]]></category>
		<category><![CDATA[css]]></category>

		<guid isPermaLink="false">http://ilujo.cn/?p=342</guid>
		<description><![CDATA[今天看到了一种浮动居中方法，用float:center实现li是浮动的，并且是居中的（li个数不固定，ul宽度未知）。平时一般设置ul的text-align:center，再设置li的display，可以实现居中。
下面说一下float:cen... ]]></description>
			<content:encoded><![CDATA[<p>今天看到了一种浮动居中方法，用float:center实现li是浮动的，并且是居中的（li个数不固定，ul宽度未知）。平时一般设置ul的text-align:center，再设置li的display，可以实现居中。</p>
<p>下面说一下float:center实现浮动居中的思路，采用的是相对定位：ul为position:relative;left:50%，然后再让li像左浮动，在让它position:relative;right:50%（或者left:-50%），那么li就像向中间浮动一样居中了。</p>
<p><strong><a title="float center" href="../demo/float-center.html">demo</a></strong></p>
]]></content:encoded>
			<wfw:commentRss>http://lefter.net/blog/float-center/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS Syestem体系格局参考图</title>
		<link>http://lefter.net/blog/css-system/</link>
		<comments>http://lefter.net/blog/css-system/#comments</comments>
		<pubDate>Mon, 10 Nov 2008 09:25:44 +0000</pubDate>
		<dc:creator>lujo</dc:creator>
				<category><![CDATA[前端开发&架构]]></category>
		<category><![CDATA[css]]></category>

		<guid isPermaLink="false">http://ilujo.cn/?p=293</guid>
		<description><![CDATA[关于整个CSS Syestem:

... ]]></description>
			<content:encoded><![CDATA[<p>关于整个CSS Syestem:<br />
<img title="css_system" src="http://lefter.net/blog/wp-content/uploads/2008/11/17_222831_css_system.gif" alt="" width="550" /><br />
<img title="css system" src="http://lefter.net/blog/wp-content/uploads/2008/11/17_223829_css_property_name.gif" alt="" width="550" /></p>
]]></content:encoded>
			<wfw:commentRss>http://lefter.net/blog/css-system/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>分享一些优化网页加载速度的小技巧</title>
		<link>http://lefter.net/blog/load-page-faster/</link>
		<comments>http://lefter.net/blog/load-page-faster/#comments</comments>
		<pubDate>Wed, 24 Sep 2008 23:59:33 +0000</pubDate>
		<dc:creator>lujo</dc:creator>
				<category><![CDATA[体验&交互&平面&策划]]></category>
		<category><![CDATA[前端开发&架构]]></category>
		<category><![CDATA[css]]></category>

		<guid isPermaLink="false">http://ilujo.cn/?p=223</guid>
		<description><![CDATA[优化图片
1、减少图片数：去除不必要的图片。
2、降低图像质量：如果不是很必要，尝试降低图像的质量，尤其是jpg格式，降低5%的质量看起来变化不是很大，但文大小的变化是比较大的。
3、... ]]></description>
			<content:encoded><![CDATA[<h3>优化图片</h3>
<p>1、减少图片数：去除不必要的图片。<br />
2、降低图像质量：如果不是很必要，尝试降低图像的质量，尤其是jpg格式，降低5%的质量看起来变化不是很大，但文大小的变化是比较大的。<br />
3、常识使用脚本文件代替效果：<br />
比如一些web2.0的样式，如果使用ps制作，每个图片基本会增加%5-%25的大小成本.<br />
相反，使用javascript代码来实现效果,仅仅只增加几个字节.<br />
图像格式的选择<br />
一般在网页上使用的图片格式有三种，jpg、png、gif。<br />
1、JPG：一般用于展示风景、人物、艺术照的摄影作品。有时也用在电脑截屏上。<br />
2、GIF：提供的颜色较少，可用在一些对颜色要求不高的地方，比如网站logo、按钮、表情等等。当然，gif的一个重要的应用是动画图片。<br />
3、PNG：PNG格式能提供透明背景，是一种专为网页展示而发明的图片格式。一般用于需要背景透明显示或对图像质量要求较高的网页上。</p>
<h3>网址后加斜杠</h3>
<p>有些网址，比如www.yahoo.com当服务器收到这样一个地址请求的时候，它需要花费时间去确定这个地址的文件类型。如果220是一个目录，不妨在网址后多加一个斜杠，让其变成http://www.www.yahoo.com，这样服务器就能一目了然地知道要访问该目录下的index或default文件，从而节省了加载时间。</p>
<h3>五、标明高度和宽度</h3>
<p>当你在网页上添加图片或表格时，你应该指定它们的高度和宽度，也就是height和width参 数。如果浏览器没有找到这两个参数，它需要一边下载图片一边计算大小，如果图片很多，浏览器需要不断地调整页面。这不但影响速度，也影响浏览体验。</p>
<h3>减少http请求</h3>
<p>当浏览者打开某个网页，浏览器会发出很多组件（图像、脚本等等），视乎网络延时情况，每个对象加载都会有所延迟。如果网页上对象很多，这可以需要花费大量的时间。</p>
<p>因此，要为http请求减负。如何减负？</p>
<p>1、去除一些不必要的对象。<br />
2、将临近的两张图片合成一张。<br />
3、合并CSS文件<br />
看看下面这段代码，需要加载三个CSS文件：<br />
&lt;link rel=&#8221;stylesheet&#8221; type=&#8221;text/css&#8221; href=&#8221;/body.css&#8221; /&gt;<br />
&lt;link rel=&#8221;stylesheet&#8221; type=&#8221;text/css&#8221; href=&#8221;/side.css&#8221; /&gt;<br />
&lt;link rel=&#8221;stylesheet&#8221; type=&#8221;text/css&#8221; href=&#8221;/footer.css&#8221; /&gt;<br />
我们可以将其合成一个：<br />
&lt;link rel=&#8221;stylesheet&#8221; type=&#8221;text/css&#8221; href=&#8221;/style.css&#8221; /&gt;<br />
从而减少http请求。<br />
<strong>其它小技巧:</strong><br />
1、去除不必要加载项。<br />
2、如果在网页上嵌入了其它网站的widget，如果有选择余地，一定要选择速度快的。<br />
3、尽量用图片代替flash，这对SEO也有好处。<br />
4、有些内容可以静态化就将其静态化，以减少服务器的负担。<br />
5、统计代码和JS文件一般放在页尾(或者使用延迟加载)。</p>
]]></content:encoded>
			<wfw:commentRss>http://lefter.net/blog/load-page-faster/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>页面中 CSS 加载方式的优化</title>
		<link>http://lefter.net/blog/load-css-faster/</link>
		<comments>http://lefter.net/blog/load-css-faster/#comments</comments>
		<pubDate>Tue, 12 Aug 2008 13:57:24 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[前端开发&架构]]></category>
		<category><![CDATA[css]]></category>

		<guid isPermaLink="false">http://lujo.wasmy.name/?p=7</guid>
		<description><![CDATA[1、应该将 CSS 放置于结构的上方（一般放置于 head 元素内）。CSS 是解释型语言，Firefox 和 IE 在等待 CSS 传输完成之前不会渲染任何东西。只有将 CSS 前置，才可在浏览器解析结构时，对页面进行... ]]></description>
			<content:encoded><![CDATA[<p>1、应该将 CSS 放置于结构的上方（一般放置于 head 元素内）。CSS 是解释型语言，Firefox 和 IE 在等待 CSS 传输完成之前不会渲染任何东西。只有将 CSS 前置，才可在浏览器解析结构时，对页面进行渲染。</p>
<blockquote><p>This causes the blank white screen problem. The page is totally blank until the stylesheet at the bottom is downloaded, on the order of 6-10 seconds for this page. The browser is waiting for the stylesheet to be loaded before it renders anything else in the page, even the static text.</p></blockquote>
<p>导致的问题就是，页面会有一段时间“朴素”，突然之间又“华丽”，用户体验很不好。</p>
<p>2、尽量使用 &lt;link rel=”stylesheet” href=”http://www.planabc/yuanxin.css” type=”text/css”&gt; 的样式导入方式，而减少 @import 的使用，更勿使用多层嵌套的 @import 。因为在 IE 里， @import 相当于将 &lt;link&gt; 放在页面尾部。</p>
<blockquote><p>This is a valid syntax, but, even though it’s in the document’s HEAD, it breaks progressive rendering and instead causes the blank white screen and Flash of Unstyled Content problems</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://lefter.net/blog/load-css-faster/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
