<?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>IInterest &#187; 边缘标签</title>
	<atom:link href="http://www.iinterest.net/tag/%e8%be%b9%e7%bc%98%e6%a0%87%e7%ad%be/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.iinterest.net</link>
	<description>Design &#38; Develope 关注用户体验,追求以用户为中心的设计.</description>
	<lastBuildDate>Thu, 26 Aug 2010 15:17:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>边缘标签:sup</title>
		<link>http://www.iinterest.net/2010/01/12/mark-sup/</link>
		<comments>http://www.iinterest.net/2010/01/12/mark-sup/#comments</comments>
		<pubDate>Tue, 12 Jan 2010 14:49:33 +0000</pubDate>
		<dc:creator>Bell</dc:creator>
				<category><![CDATA[HTML & CSS]]></category>
		<category><![CDATA[边缘标签]]></category>

		<guid isPermaLink="false">http://www.iinterest.net/?p=700</guid>
		<description><![CDATA[&#60;sup&#62;是用来定义上标文本的标签,平常很少用到,基本上属于边缘标签.不过今天在项目中遇到,在调试过程中发现这小子比较难伺候,这里模拟了个简单的代码环境: &#60;!DOCTYPE html PUBLIC &#34;-//W3C//DTD XHTML 1.0 Transitional//EN&#34; &#34;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.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;temp&#60;/title&#62; &#60;style type=&#34;text/css&#34; media=&#34;all&#34;&#62; * { margin:0; padding:0; font:12px/1.5 Arial, Helvetica, sans-serif;} body{ background:url(images/grid.png) no-repeat;} .sup-tm{ width:300px; margin:20px; border:1px solid #ff6600; line-height:20px; overflow:hidden;} &#8230; <a href="http://www.iinterest.net/2010/01/12/mark-sup/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>&lt;sup&gt;是用来定义上标文本的标签,平常很少用到,基本上属于边缘标签.不过今天在项目中遇到,在调试过程中发现这小子比较难伺候,这里模拟了个简单的代码环境:</p>
<div class="runcode">
<p><textarea name="runcode" class="runcode_text" id="runcode_Jci3Nx">
&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.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;temp&lt;/title&gt;
&lt;style type=&quot;text/css&quot; media=&quot;all&quot;&gt;
* { margin:0; padding:0; font:12px/1.5 Arial, Helvetica, sans-serif;}
body{ background:url(images/grid.png) no-repeat;}
.sup-tm{ width:300px; margin:20px; border:1px solid #ff6600; line-height:20px; overflow:hidden;}
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div class=&quot;sup-tm&quot;&gt;
	123&lt;sup&gt;123&lt;/sup&gt;
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
</textarea></p>
<p><input type="button" value="运行" class="runcode_button" onclick="runcode_open_new('runcode_Jci3Nx');"/> <input type="button" value="复制" class="runcode_button" onclick="runcode_copy('runcode_Jci3Nx');"/> 提示：你可以先修改部分代码再运行。</p>
</div>
<p>从代码中可以看到我定义了一个宽300px,高20px,字体大小为12px,行高为1.5em的模型,再来看看它在各浏览器中的表现:<br />
<span id="more-700"></span><br />
1. IE6,7<br />
<img src="http://image215.poco.cn/mypoco/myphoto/20100112/22/51737245201001122242242800298563392_002.jpg" alt="IE" /><br/><br />
2.FF<br />
<img src="http://image215.poco.cn/mypoco/myphoto/20100112/22/51737245201001122242242800298563392_001.jpg" alt="FF" /><br/><br />
3.chrome<br />
<img src="http://image215.poco.cn/mypoco/myphoto/20100112/22/51737245201001122242242800298563392_000.jpg" alt="chrome" /><br/><br />
从图中对比来看,IE是完全符合我设想的效果,但在FF和chrome下有2个问题:(谁才是对的呢?&#8230;囧)<br />
1.正常文本和上标文本的字体大小相同,都为12px(明显是受到了font:12px/1.5&#8230;的影响,在未定义字体的时候两者是大小是有区别的);<br />
2.模型的高度超过了定义的20px;</p>
<p><strong>调试:</strong><br />
经过反复的调试最终得到一个并不完美但可以让人接受的效果(用了好多hack,orz):</p>
<div class="runcode">
<p><textarea name="runcode" class="runcode_text" id="runcode_dtpZrN">
&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.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;temp&lt;/title&gt;
&lt;style type=&quot;text/css&quot; media=&quot;all&quot;&gt;
* { margin:0; padding:0; font:12px/1.5 Arial, Helvetica, sans-serif;}
body{ background:url(images/grid.png) no-repeat;}
.sup-tm{ width:300px; margin:20px; border:1px solid #ff6600; line-height:20px; overflow:hidden;}
	/*ff*/
	.sup-tm sup{ font-size:10px; vertical-align:top;}
	/*IE*/
	html*.sup-tm sup{ font-size:12px; vertical-align:super;}
	/*chrome*/
	@media screen and (-webkit-min-device-pixel-ratio:0){.sup-tm sup{ vertical-align:top;}}
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div class=&quot;sup-tm&quot;&gt;
	123&lt;sup&gt;123&lt;/sup&gt;
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
</textarea></p>
<p><input type="button" value="运行" class="runcode_button" onclick="runcode_open_new('runcode_dtpZrN');"/> <input type="button" value="复制" class="runcode_button" onclick="runcode_copy('runcode_dtpZrN');"/> 提示：你可以先修改部分代码再运行。</p>
</div>
<p>在调试中发现:定义sup的字体大小,只对IE和FF有效,chrome无视sup的font-size属性&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.iinterest.net/2010/01/12/mark-sup/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
