<?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; 图标</title>
	<atom:link href="http://witmax.cn/tag/icon/feed" rel="self" type="application/rss+xml" />
	<link>http://witmax.cn</link>
	<description>记录成长路途上的点滴总结</description>
	<lastBuildDate>Sat, 12 May 2012 04:45:25 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>【CSS】组装图标</title>
		<link>http://witmax.cn/css-assembled-icon.html</link>
		<comments>http://witmax.cn/css-assembled-icon.html#comments</comments>
		<pubDate>Fri, 12 Feb 2010 12:34:37 +0000</pubDate>
		<dc:creator>晴枫</dc:creator>
				<category><![CDATA[网页设计]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[图标]]></category>

		<guid isPermaLink="false">http://witmax.cn/?p=707</guid>
		<description><![CDATA[一般情况下，图标总是事先做成图片然后直接拿来调用就行了。但是碰到一个状况需要做3分比例饼图，采用3种颜色标识不同内容在总体所占的比例，简单起见，所占比例为1/8的倍数。效果如下： 这样把每一个比例单独做个图，未免工作量过大，没算错的话需要做45个图；当然你可能会想到用程序去生成图，但也要会图像编程才行，这里先不考虑。 我的方法是把图分解，做一张灰圆，然后分别做8个不同8分比例的浅蓝、深蓝扇形，这个做起来还是比较方便的。做好后利用雪碧工具把图拼合成一张，如下： 利用gif图片的透明性进行CSS组装，如下 &#60;!DOCTYPE html PUBLIC &#34;-//W3C//DTD XHTML 1.1//EN&#34; &#34;http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd&#34;&#62; &#60;html xmlns=&#34;http://www.w3.org/1999/xhtml&#34; &#62; &#60;head&#62; &#60;meta http-equiv=&#34;Content-Type&#34; content=&#34;text/html; charset=UTF-8&#34; /&#62; &#60;title&#62;CSS组装图标&#60;/title&#62; &#60;/head&#62; &#60;body&#62; &#60;style&#62; .icon{ width:16px; height:16px; background:url(http://witmax.cn/img/css-original-icon.gif) no-repeat -256px 0px; display: inline-block; } .icon span, .icon span span{ width:16px; height:16px; background-repeat:no-repeat; background-image:url(http://witmax.cn/img/css-original-icon.gif); display: inline-block; } .b1 { background-position:0px 0px; } .b2 { background-position:-16px 0px; [...]<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">猜您喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fwitmax.cn%2Fcss-control-cellspacing-cellpadding.html&from=http%3A%2F%2Fwitmax.cn%2Fcss-assembled-icon.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">【CSS】用css控制cellspacing、cellpadding分析</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fwitmax.cn%2Fcss-min-height.html&from=http%3A%2F%2Fwitmax.cn%2Fcss-assembled-icon.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">【CSS】设置div的最小高度（多浏览器兼容）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fwitmax.cn%2Fcss-text-selection.html&from=http%3A%2F%2Fwitmax.cn%2Fcss-assembled-icon.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">【CSS】设置选中文字的颜色和背景色</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fwitmax.cn%2Fcss-layout-1.html&from=http%3A%2F%2Fwitmax.cn%2Fcss-assembled-icon.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">【CSS】左侧定宽、右侧宽度自适应布局</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>一般情况下，图标总是事先做成图片然后直接拿来调用就行了。但是碰到一个状况需要做3分比例饼图，采用3种颜色标识不同内容在总体所占的比例，简单起见，所占比例为1/8的倍数。效果如下：</p>
<p><a href="http://witmax.cn/img/css-assembled-icon.png" rel="lightbox[707]" title="组装图标效果"><img class="alignnone" title="组装图标效果" src="http://witmax.cn/img/css-assembled-icon.png" alt="组装图标效果" width="23" height="23" /></a></p>
<p>这样把每一个比例单独做个图，未免工作量过大，没算错的话需要做45个图；当然你可能会想到用程序去生成图，但也要会图像编程才行，这里先不考虑。</p>
<p><span id="more-707"></span></p>
<p>我的方法是把图分解，做一张灰圆，然后分别做8个不同8分比例的浅蓝、深蓝扇形，这个做起来还是比较方便的。做好后利用雪碧工具把图拼合成一张，如下：</p>
<p><a href="http://witmax.cn/img/css-original-icon.gif" rel="lightbox[707]" title="原始图标"><img class="alignnone" title="原始图标" src="http://witmax.cn/img/css-original-icon.gif" alt="原始图标" width="272" height="16" /></a></p>
<p>利用gif图片的透明性进行CSS组装，如下</p>
<div class="runcode">
<p><textarea name="runcode" style="height:280px;width:540px;font-size:12px" class="runcode_text" id="runcode_4k91Sk"> &lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.1//EN&quot; &quot;http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; &gt;
&lt;head&gt;
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=UTF-8&quot; /&gt;
&lt;title&gt;CSS组装图标&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;style&gt;
.icon{ width:16px; height:16px; background:url(http://witmax.cn/img/css-original-icon.gif) no-repeat -256px 0px; display: inline-block; }
    .icon span, .icon span span{ width:16px; height:16px; background-repeat:no-repeat; background-image:url(http://witmax.cn/img/css-original-icon.gif); display: inline-block; }
    .b1 { background-position:0px 0px; }
    .b2 { background-position:-16px 0px; }
    .b3 { background-position:-32px 0px; }
    .b4 { background-position:-48px 0px; }
    .b5 { background-position:-64px 0px; }
    .b6 { background-position:-80px 0px; }
    .b7 { background-position:-96px 0px; }
    .b8 { background-position:-112px 0px; }
    .d1 { background-position:-128px 0px; }
    .d2 { background-position:-144px 0px; }
    .d3 { background-position:-160px 0px; }
    .d4 { background-position:-176px 0px; }
    .d5 { background-position:-192px 0px; }
    .d6 { background-position:-208px 0px; }
    .d7 { background-position:-224px 0px; }
    .d8 { background-position:-250px 0px; }
&lt;/style&gt;
&lt;span class=&quot;icon&quot;&gt;&lt;span class=&quot;b6&quot;&gt;&lt;span class=&quot;d3&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;3:3:2&lt;br /&gt;
&lt;span class=&quot;icon&quot;&gt;&lt;span class=&quot;b4&quot;&gt;&lt;span class=&quot;d2&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;2:2:4&lt;br /&gt;
&lt;span class=&quot;icon&quot;&gt;&lt;span class=&quot;b7&quot;&gt;&lt;span class=&quot;d4&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;4:3:1&lt;br /&gt;
&lt;a href=&quot;http://witmax.cn&quot; target=&quot;_blank&quot;&gt;晴枫&lt;/a&gt;制作
&lt;/body&gt;
&lt;/html&gt;
</textarea></p>
<p><input type="button" value="运行" class="runcode_button" onclick="runcode_open_new('runcode_4k91Sk');"/> <input type="button" value="复制" class="runcode_button" onclick="runcode_copy('runcode_4k91Sk');"/> <input type="button" value="另存代码" class="runcode_button" onclick="saveCode('runcode_4k91Sk','runcode_4k91Sk');"/> 提示：你可以先修改部分代码再运行。</p>
</div>
<p>源码下载：<a class="downloadlink" href="http://witmax.cn/downloads/24" title="版本：v1.0 已下载280次" target="_blank">CSS拼装图标源码</a></p>
<p>参考文章： Tencent ISD Webteam《<a href="http://webteam.tencent.com/?p=1330">由黄钻等级图标处理引发的思考</a>》</p>
<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">猜您喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fwitmax.cn%2Fcss-control-cellspacing-cellpadding.html&from=http%3A%2F%2Fwitmax.cn%2Fcss-assembled-icon.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">【CSS】用css控制cellspacing、cellpadding分析</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fwitmax.cn%2Fcss-min-height.html&from=http%3A%2F%2Fwitmax.cn%2Fcss-assembled-icon.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">【CSS】设置div的最小高度（多浏览器兼容）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fwitmax.cn%2Fcss-text-selection.html&from=http%3A%2F%2Fwitmax.cn%2Fcss-assembled-icon.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">【CSS】设置选中文字的颜色和背景色</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fwitmax.cn%2Fcss-layout-1.html&from=http%3A%2F%2Fwitmax.cn%2Fcss-assembled-icon.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">【CSS】左侧定宽、右侧宽度自适应布局</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://witmax.cn/css-assembled-icon.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

