<?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>LIGHT Weblog &#187; CSS</title>
	<atom:link href="http://lightory.net/tag/css/feed/" rel="self" type="application/rss+xml" />
	<link>http://lightory.net</link>
	<description>刘白光的博客</description>
	<lastBuildDate>Thu, 03 May 2012 11:33:07 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Sexy Buttons &#8211; 快速制作漂亮的 Web 按钮</title>
		<link>http://lightory.net/sexy-buttons/466/</link>
		<comments>http://lightory.net/sexy-buttons/466/#comments</comments>
		<pubDate>Wed, 17 Feb 2010 12:00:29 +0000</pubDate>
		<dc:creator>LIGHT</dc:creator>
				<category><![CDATA[杂谈杂论]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Front-End]]></category>

		<guid isPermaLink="false">http://lightory.net/?p=466</guid>
		<description><![CDATA[作为 Web 界面基本元素之一，按钮有着非常重要的作用。多数浏览器的默认按钮样式都十分简陋，想要制作精致一点的按钮又颇费功夫。 想要快速制作漂亮的 Web 按钮？不妨试试 Sexy Buttons。 Sexy... ]]></description>
			<content:encoded><![CDATA[<link rel="stylesheet" href="http://sexybuttons.googlecode.com/svn/trunk/sexybuttons.css" type="text/css" />
<p>作为 Web 界面基本元素之一，按钮有着非常重要的作用。多数浏览器的默认按钮样式都十分简陋，想要制作精致一点的按钮又颇费功夫。</p>
<p>想要快速制作漂亮的 Web 按钮？不妨试试 <a href="http://code.google.com/p/sexybuttons/">Sexy Buttons</a>。</p>
<p><a href="http://lightory.net/sexy-buttons/466/"><img src="http://i45.tinypic.com/bgxo2w.jpg" alt="Sexy Buttons" /></a></p>
<p><a href="http://code.google.com/p/sexybuttons/">Sexy Buttons</a> 是一个基于 HTML/CSS 的框架（其实就是一个 CSS 文件和一些图标），其特性如下：</p>
<ul>
<li>不使用 JavaScript，纯 CSS</li>
<li>支持使用 <tt>&lt;button&gt;</tt> 或 <tt>&lt;a&gt;</tt> 标签</li>
<li>支持多种状态： normal, hover/focus, active, and disabled.</li>
<li>通过改变 HTML 标签的 class，可以制作出多种风格不同的按钮</li>
</ul>
<p>下面是一些简单的示例。</p>
<p><strong>基本使用</strong>：</p>
<pre lang="html4strict" escaped="true">
<a class="sexybutton" href="#"><span><span>提交</span></span></a>
<button class="sexybutton"><span><span>取消</span></span></button>
</pre>
<p><a class="sexybutton" href="http://lightory.net/sexy-buttons/466/"><span><span>提交</span></span></a><button class="sexybutton"><span><span>取消</span></span></button></p>
<p><strong>加上图标</strong>：在最内层添加一个带有特殊 class 的 span 标签，或者直接通过 img 标签添加图标（Sexy Buttons 自带有上千个图标）。</p>
<pre lang="html4strict" escaped="true">
<a class="sexybutton" href="#"><span><span><span class="ok">提交</span></span></span></a>
<button class="sexybutton"><span><span><span class="cancel">取消</span></span></span></button>
</pre>
<p><a class="sexybutton" href="http://lightory.net/sexy-buttons/466/"><span><span><span class="ok">Submit</span></span></span></a><button class="sexybutton"><span><span><span class="cancel">Cancel</span></span></span></button></p>
<p><strong>改变尺寸</strong>：给外层标签添加特殊的 class</p>
<pre lang="html4strict" escaped="true">
<a class="sexybutton" href="#"><span><span>Normal Button</span></span></a>
<a class="sexybutton sexymedium" href="#"><span><span>Medium Button</span></span></a>
<a class="sexybutton sexylarge" href="#"><span><span>Large Button</span></span></a>
</pre>
<p><a class="sexybutton" href="http://lightory.net/sexy-buttons/466/"><span><span>Normal Button</span></span></a><a class="sexybutton sexymedium" href="http://lightory.net/sexy-buttons/466/"><span><span>Medium Button</span></span></a><a class="sexybutton sexylarge" href="http://lightory.net/sexy-buttons/466/"><span><span>Large Button</span></span></a></p>
<p><strong>改变样式</strong>：给外层标签添加特殊的 class</p>
<pre lang="html4strict" escaped="true">
<button class="sexybutton sexyorange"><span><span><span class="ok">Orange Button</span></span></span></button>
<button class="sexybutton sexyyellow"><span><span><span class="ok">Yellow Button</span></span></span></button>
<button class="sexybutton sexysimple"><span class="ok">Simple Button</span></button>
</pre>
<p><button class="sexybutton sexyorange"><span><span><span class="ok">Orange Button</span></span></span></button><button class="sexybutton sexyyellow"><span><span><span class="ok">Yellow Button</span></span></span></button><button class="sexybutton sexysimple"><span class="ok">Simple Button</span></button></p>
<p>更多的使用方法，可以参见其<a href="http://sexybuttons.googlecode.com/svn/trunk/index.html">官方演示</a>，或者直接阅读 sexybutton.css 文件。另外，根据实际需要，你也可以方便地对 Sexy Buttons 进行扩展。</p>
<p>我很喜欢 Sexy Buttons 所暗含的 Web 界面元素组件化的思想。</p>

	<p><b>Tags: </b><a href="http://lightory.net/tag/css/" title="CSS" rel="tag">CSS</a>, <a href="http://lightory.net/tag/front-end/" title="Front-End" rel="tag">Front-End</a></p>
]]></content:encoded>
			<wfw:commentRss>http://lightory.net/sexy-buttons/466/feed/</wfw:commentRss>
		<slash:comments>28</slash:comments>
		</item>
		<item>
		<title>CSS调试的技巧</title>
		<link>http://lightory.net/css-debug-tips/441/</link>
		<comments>http://lightory.net/css-debug-tips/441/#comments</comments>
		<pubDate>Thu, 24 Dec 2009 04:35:25 +0000</pubDate>
		<dc:creator>LIGHT</dc:creator>
				<category><![CDATA[杂谈杂论]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Debug]]></category>
		<category><![CDATA[Front-End]]></category>

		<guid isPermaLink="false">http://lightory.net/?p=441</guid>
		<description><![CDATA[最近在读《精通CSS》一书消遣。 全书以技巧为主、理论为辅，介绍了许多 CSS 应用小技巧，如果忽略一些令人哭笑不得的术语翻译之外，这是一本难得的好书，十分适合进阶之用。 第九章《bug ... ]]></description>
			<content:encoded><![CDATA[<p><img style="margin: 0px 10px 10px 0px; float: right;" src="http://t.douban.com/lpic/s2008593.jpg" alt="" />最近在读《<a href="http://www.douban.com/subject/1898098/" target="_blank">精通CSS</a>》一书消遣。</p>
<p>全书以技巧为主、理论为辅，介绍了许多 CSS 应用小技巧，如果忽略一些令人哭笑不得的术语翻译之外，这是一本难得的好书，十分适合进阶之用。</p>
<p>第九章《bug 和 bug 修复》，介绍了一些 CSS 调试的技巧，尤为实用。毕竟，与其授人以鱼，不若授人以渔。若不会自己研究、解决问题，就算你会用再多 CSS hack，遇到新 bug 时，也是白搭。</p>
<p>下面就加上我自己的一些理解，整理、总结如下：</p>
<p>0、<strong>使用更符合标准的浏览器</strong></p>
<p>先使用更符合标准的浏览器（如 Firefox、Opera、Chrome 等）作为主要开发浏览器，页面显示正确后，再在能力较差的浏览器（如 IE）中进行兼容性测试。</p>
<p>1、<strong>进行 W3C 校验</strong></p>
<p>遇到问题时，不要直接归罪于浏览器 bug，很多时候，问题源于你不规范的代码。尝试进行 <a href="http://validator.w3.org/" target="_blank">W3C 校验</a>，这能帮助你发现代码中的不规范之处。</p>
<p>当然，这不意味着必须做到 100% validate。W3C 验证只是一个参考标准，而不是必须无条件遵循的规则。</p>
<p>2、<strong>给相关元素加上边框</strong></p>
<p>尝试隔离问题，识别症状，查明是什么导致了这个问题。隔离问题的方法之一是给相关元素加上边框，看它们的反应。</p>
<p>如果你使用 Firefox 作为开发浏览器，推荐 <a href="https://addons.mozilla.org/zh-CN/firefox/addon/60" target="_blank">Web Developer 扩展</a>，它可以方便地给指定元素加上边框，无需修改代码。除此之外，它还附带了许多其它的调试工具。</p>
<p>3、<strong>创建基本测试案例</strong></p>
<p>如果问题比较棘手，可以创建基本测试案例（重现 bug 所需的最少 HTML/CSS ），去掉一些无关变量，使问题尽可能简单。</p>
<p>4、<strong>回避浏览器 bug</strong></p>
<p>对于浏览器 bug，最简单的解决方案是——回避它。尝试使用其它方案实现相同的表现效果，实在没办法了再使用 CSS hack（这可能会留下隐患）。</p>
<p style="margin:0;padding:0;height:1px;overflow:hidden;">
    <script type="text/javascript"><!--
        var wumiiSitePrefix = "http://lightory.net";
        var wumiiEnableCustomPos = false;
        var wumiiParams = "&#038;num=5&#038;mode=3&#038;displayInFeed=0&#038;version=1.0.5.5&#038;pf=WordPress3.3";
    //--></script><script type="text/javascript" src="http://widget.wumii.com/ext/relatedItemsWidget.htm"></script><a href="http://www.wumii.com/widget/relatedItems.htm" style="border:0;"><img src="http://static.wumii.com/images/pixel.png" alt="无觅相关文章插件，快速提升流量" style="border:0;padding:0;margin:0;" /></a></p>

	<p><b>Tags: </b><a href="http://lightory.net/tag/css/" title="CSS" rel="tag">CSS</a>, <a href="http://lightory.net/tag/debug/" title="Debug" rel="tag">Debug</a>, <a href="http://lightory.net/tag/front-end/" title="Front-End" rel="tag">Front-End</a></p>
]]></content:encoded>
			<wfw:commentRss>http://lightory.net/css-debug-tips/441/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
	</channel>
</rss>

