<?xml version="1.0" standalone="yes"?>
<?xml-stylesheet type="text/xsl" href="css/rss.xslt"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>SUNThink 三思 - 前端</title><link>http://www.sunthink.org/</link><description>{思考前端;思考用户体验;思考互联网;} - </description><generator>RainbowSoft Studio Z-Blog 1.8 Arwen Build 90619</generator><language>zh-CN</language><copyright>回到首页 前端 用户体验 互联网 三思集 兵器谱 相册 标签云 搜索 给我留言 M 回到顶部↑Copyright SUNThink.org 三思 Rights Reserved. 本blog服务器空间由  河南371网络服务专家 极速支持 豫ICP备09034799号 </copyright><pubDate>Wed, 22 May 2013 02:55:18 +0800</pubDate><item><title>ime-mode:disabled css实现关闭文本框输入法</title><author>345411190@qq.com (admin)</author><link>http://www.sunthink.org/post/ime-mode.html</link><pubDate>Sat, 21 Nov 2009 14:17:53 +0800</pubDate><guid>http://www.sunthink.org/post/ime-mode.html</guid><description><![CDATA[<p>&nbsp;&nbsp;&nbsp;&nbsp;最近客服部的MM反映：用户总是在输入电话的时候不小心开启了全角无法通过格式验证而打来电话求助。如图：</p><p><img title="" alt="" src="http://www.sunthink.org/upload/css自动关闭文本框输入法.gif" onload="ResizeImage(this,600)" /></p><p>&nbsp;&nbsp;&nbsp;&nbsp;就是在后面增加了，请输入半角数字的提示效果也不会很好，因为很多用户不知道什么是全角半角，都是无意中开启了全角状态。我们在平时填写表单的时候也会这样，上个文本框是输入中文，到下个要输入英文，就要来回切换输入法，极容易出现全角验证不通过，还很麻烦。</p><p>&nbsp;&nbsp;&nbsp;&nbsp;路人甲：用<strong>js全角转半角</strong>不就可以了？</p><p>&nbsp;&nbsp;&nbsp;&nbsp;这个当然可以，不过其实用css就可以了：<strong>ime-mode:disabled</strong>。在群里问了一下很多人都不用这个css属性，测试了下其实挺好用的（<strong>省去了用户切换输入法的麻烦还规避了用户容易输错数字的错误，不用白不用</strong>），看一个简单的例子：</p><p><a href="http://www.sunthink.org/down/demo/ime-mode.html" target="_blank">ime-mode:disabled css实现关闭文本框输入法</a></p><div>附：苏昱css手册中对此属性的解释：</div><div id="idContentTitle"><strong><span id="idTitleName">ime-mode&nbsp;</span></strong></div><div class="cssColumnTitle">语法：</div><div><b>ime-mode : </b><span class="cssDefault"><b>auto</b></span> | <b>active</b>  | <b>inactive</b> | <b>disabled</b></div><div class="cssColumnTitle">取值：</div><table style="width: 542px; height: 105px;">    <tbody>        <tr>            <td nowrap=""><b>auto </b></td>            <td nowrap=""><b>:</b></td>            <td><b>默认值</b>。不影响IME的状态。与不指定<b> ime-mode </b>属性时相同</td>        </tr>        <tr>            <td nowrap=""><b>active </b></td>            <td nowrap=""><b>:</b></td>            <td>指定所有使用IME输入的字符。即激活本地语言输入法。用户仍可以撤销激活IME</td>        </tr>        <tr>            <td nowrap=""><b>inactive </b></td>            <td nowrap=""><b>:</b></td>            <td>指定所有不使用IME输入的字符。即激活非本地语言。用户仍可以撤销激活IME</td>        </tr>        <tr>            <td nowrap=""><b>disabled </b></td>            <td nowrap=""><b>:</b></td>            <td>完全禁用IME。对于有焦点的控件(如输入框)，用户不可以激活IME</td>        </tr>    </tbody></table>]]></description><category>前端</category><comments>http://www.sunthink.org/post/ime-mode.html#comment</comments><wfw:comment>http://www.sunthink.org/</wfw:comment><wfw:commentRss>http://www.sunthink.org/feed.asp?cmt=25</wfw:commentRss><trackback:ping>http://www.sunthink.org/cmd.asp?act=tb&amp;id=25&amp;key=955179cc</trackback:ping></item><item><title>不常用却很有用的标签</title><author>345411190@qq.com (admin)</author><link>http://www.sunthink.org/post/biaoqian.html</link><pubDate>Fri, 11 Sep 2009 14:53:11 +0800</pubDate><guid>http://www.sunthink.org/post/biaoqian.html</guid><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp;Xhtml有很多不常用却很有用的标签。有的能事半功倍，有的能改进语义，有的则能提高易用性，<br/>我总结了一些，总结的原则是有用而且能用，就是大多数浏览器得支持，否则就不算“上上签”了。只能望“签”兴叹又有什么用呢？<br/><font size="4"><b>&lt;base&gt;标签</b></font><br/>&nbsp;&nbsp;&nbsp;&nbsp;作用：<base>标签为页面中所有链接指定默认链接地址或链接目标。有时候我们需要让首页的链接全部在新窗口中打开，我们一般会这样写<a href="#" target="_blank">链接</a>，而使用这个标签就能一下搞定了！<br/>&nbsp;&nbsp;&nbsp;&nbsp;<b>属性：</b><br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Href:链接地址<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;target:目标，他的值可以是_blank,_parent,_self,_top,可以在除Strict模式下使用，这个用法我最先是在163.com上发现的。<br/>&nbsp;&nbsp;&nbsp;&nbsp;<b>用法：</b><br/>[CODE=html]<head><!—写在head标签之间--><br/><base href="http://www.qq.com/" /> <!—将默认链接定义为http://www.qq.com/--><br/><base target="_blank" /> <!—将默认链接目标定义为新窗口中打开--><br/></head>[/CODE]<br/><font size="4"><b>&lt;caption&gt;标签</b></font><br/>&nbsp;&nbsp;&nbsp;&nbsp;<b>作用：</b>caption标签用来定义表格的标题，给表格定义一个标题，来说明这个表格是干什么的，岂不是很有“语义”，caption应该写在table之后，默认的样式是居中显示在表格的顶部。你可以通过css来改变它的样式。<br/>&nbsp;&nbsp;&nbsp;&nbsp;<b>用法：</b><br/>[CODE=html]<table width="200" border="1" ><caption> <!--caption应该写在table之后--><br/>其实我是caption<br/></caption><br/><tr><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td>&nbsp;</td><td>&nbsp;</td></tr></table>[/CODE]<br/><font size="4"><b>&lt;thead&gt;标签、&lt;tbody&gt;标签、&lt;tfoot&gt;标签</b></font><br/>&nbsp;&nbsp;&nbsp;&nbsp;作用：thead、tfoot 以及 tbody标签跟他们的名字那样，分别是表格的头部（很多人只是用th）、主题、和底部，他们能让表格更加语义化的同时，也能让我们更加方便的控制表格的表现。国外还有人用很变态地方法用这三个表其做出标题能跟随表格，或者tbody固定高度，多出的行数出现滚动条。有兴趣的可以搜素下或者是这做一下。<br/>注意：<font color="Red">如果您使用 thead、tfoot 以及 tbody 元素，您就必须使用全部的元素。它们的出现次序是：thead、tfoot、tbody，这样浏览器就可以在收到所有数据前呈现页脚了。</font><br/>&nbsp;&nbsp;&nbsp;&nbsp;<b>用法：</b><br/>[CODE=html]<table border="1"><thead><tr><th>科目</th><th>分数</th></tr></thead><tfoot><br/><tr><td>总分</td><td>159</td></tr></tfoot><br/><br/><tbody><tr><td>语文</td><td>99</td></tr><tr><td>数学</td><td>60</td></tr></tbody></table>[/CODE]<br/><font size="4"><b>&lt;fieldset&gt;标签和&lt;legend&gt;标签</b></font><br/>&nbsp;&nbsp;&nbsp;&nbsp;<b>作用：</b>&lt;fieldset&gt;元素用来分类表单中的元素，而&lt;legend&gt;则能给这个组定义一个标题。你一定见过类似下面domo的布局吧！他们也可以通过css定义样式。<br/>&nbsp;&nbsp;&nbsp;&nbsp;<b>用法:</b><br/>[CODE=html]<form><fieldset><br/><legend>基本信息</legend><br/>姓名: <input type="text" /><br/>性别: <input type="text" /><br/></fieldset><br/></form>[/CODE]<br/><font size="4"><b>&lt;sub&gt; 标签和&lt;sup&gt; 标签</b></font><br/>&nbsp;&nbsp;&nbsp;&nbsp;作用：&lt;sub&gt; 标签和&lt;sub&gt; 标签分别是上标和下标，虽然他们在各个浏览器的表现不一样，你<br/>同样可以使用css定义他们的样式。<br/>&nbsp;&nbsp;&nbsp;&nbsp;<b>用法：</b><br/>[CODE=html]2<sup>我是上标</sup><br/>2<sub>我是下标</sub>[/CODE]<br/><font size="4"><b>&lt;label&gt;标签</b></font><br/>&nbsp;&nbsp;&nbsp;&nbsp;<b>作用：</b>label 标签的使用可以扩大表单的点击区域来改进表单的易用性。看看下面的用法：点击文字的时候相当于点击了单选控件，这样用户体验是不是会更好一些？<br/>&nbsp;&nbsp;&nbsp;&nbsp;<b>用法：</b><br/>[CODE=html]<form><label for="nan">先生</label><br/><input type="radio" name="sex" id="nan" /><br/><br /><br/><label for="nv">女士</label><br/><input type="radio" name="sex" id="nv" /><br/></form>[/CODE]<br/><font size="4"><b>&lt;optgroup&gt; 标签</b></font><br/>&nbsp;&nbsp;&nbsp;&nbsp;<b>作用：</b><option> 标签可以给select中的option进行分组，这在下拉项目很多的时候很有用，配合label标签给每组命名。你也可以像淘宝那样给每组用css定义不同的颜色。<br/>&nbsp;&nbsp;&nbsp;&nbsp;<b>用法：</b><br/>[CODE=html]<select><optgroup label="自驾游"> <!--配合label标签给每组命名--><br/><option>省内</option><option>省外</option></optgroup><br/><optgroup label="旅行社"><br/><option>省内</option><option>省外</option><option>国外</option></optgroup><br/></select>[/CODE]<br/>&nbsp;&nbsp;&nbsp;&nbsp;你如果对更多的xhtml标签感兴趣，可以考虑看一看《HTML和XHTML权威指南》这本书，你也能在网上找到电子版的。我看过英文影印版的，虽然是英文但也不是太难看懂。<br/>&nbsp;&nbsp;&nbsp;&nbsp;你要是知道其他很有用的标签告诉我们吧！<br/>&nbsp;&nbsp;&nbsp;&nbsp;附：<a href="http://www.sunthink.org/down/book/OReilly.HTML.and.XHTML.The.Definitive.Guide.6th.Edition.Oct.2006.chm" target="_blank">《HTML和XHTML权威指南》第六版下载</a><br/>]]></description><category>前端</category><comments>http://www.sunthink.org/post/biaoqian.html#comment</comments><wfw:comment>http://www.sunthink.org/</wfw:comment><wfw:commentRss>http://www.sunthink.org/feed.asp?cmt=23</wfw:commentRss><trackback:ping>http://www.sunthink.org/cmd.asp?act=tb&amp;id=23&amp;key=f719db82</trackback:ping></item><item><title>彻底弄清楚haslayout概念[转]</title><author>345411190@qq.com (admin)</author><link>http://www.sunthink.org/post/haslayout.html</link><pubDate>Wed, 19 Aug 2009 10:07:16 +0800</pubDate><guid>http://www.sunthink.org/post/haslayout.html</guid><description><![CDATA[要想更好的理解 css， 尤其是 IE 下对 css 的渲染，haslayout 是一个非常有必要彻底弄清除的概念。大多IE下的显示错误，就是源于 haslayout。<br/><br/><b><font size="4">什么是 haslayout ？</font></b><br/>haslayout 是Windows Internet Explorer渲染引擎的一个内部组成部分。在Internet Explorer中，一个元素要么自己对自身的内容进行计算大小和组织，要么依赖于父元素来计算尺寸和组织内容。为了调节这两个不同的概念，渲染引擎采用 了 hasLayout 的属性，属性值可以为true或false。当一个元素的 hasLayout 属性值为true时，我们说这个元素有一个布局（layout）<br/><br/>当一个元素有一个布局时，它负责对自己和可能的子孙元素进行尺寸计算和定位。简单来说，这意味着这个元素需要花更多的代价来维护自身和里面的内容， 而不是依赖于祖先元素来完成这些工作。因此，一些元素默认会有一个布局。当我们说一个元素“拥有layout”或“得到layout”，或者说一个元素 “has layout” 的时候，我们的意思是指它的微软专有属性 hasLayout 被设为了 true 。一个“layout元素”可以是一个默认就拥有 layout 的元素或者是一个通过设置某些 CSS 属性得到 layout 的元素。如果某个HTML元素拥有 haslayout 属性，那么这个元素的 haslayout 的值一定只有 true，haslayout 为只读属性 一旦被触发，就不可逆转。通过 IE Developer Toolbar 可以查看 IE 下 HTML 元素是否拥有haslayout，在 IE Developer Toolbar 下，拥有 haslayout 的元素，通常显示为“haslayout = -1”。<br/><br/>负责组织自身内容的元素将默认有一个布局，主要包括以下元素（不完全列表）：<br/><br/>* body and html<br/>* table, tr, th, td<br/>* img<br/>* hr<br/>* input, button, file, select, textarea, fieldset<br/>* marquee<br/>* frameset, frame, iframe<br/>* objects, applets, embed<br/><br/>对于并非所有的元素都默认有布局，微软给出的主要原因是“性能和简洁”。如果所有的元素都默认有布局，会对性能和内存使用上产生有害的影响。<br/><br/><b><font size="4">如何激发 haslayout？</font></b><br/>大部分的 IE 显示错误，都可以通过激发元素的 haslayout 属性来修正。可以通过设置 css 尺寸属性(width/height)等来激发元素的 haslayout，使其“拥有布局”。如下所示，通过设置以下 css 属性即可。<br/><br/>* display: inline-block<br/>* height: (任何值除了auto)<br/>* float: (left 或 right)<br/>* position: absolute<br/>* width: (任何值除了auto)<br/>* writing-mode: tb-rl<br/>* zoom: (除 normal 外任意值)<br/><br/>Internet Explorer 7 还有一些额外的属性(不完全列表):<br/><br/>* min-height: (任意值)<br/>* max-height: (除 none 外任意值)<br/>* min-width: (任意值)<br/>* max-width: (除 none 外任意值)<br/>* overflow: (除 visible 外任意值)<br/>* overflow-x: (除 visible 外任意值)<br/>* overflow-y: (除 visible 外任意值)<br/>* position: fixed<br/><br/>其中 overflow-x 和 overflow-y 是 css3 盒模型中的属性，目前还未被浏览器广泛支持。<br/><br/>对于内联元素(默认即为内联的元素，如 span，或 display:inline; 的元素)，<br/><br/>width 和 height 只在 IE5.x 下和 IE6 或更新版本的 quirks 模式下触发 hasLayout 。而对于 IE6，如果浏览器运行于标准兼容模式下，内联元素会忽略 width 或 height 属性，所以设置 width 或 height 不能在此种情况下令该元素具有 layout。 <br/>zoom 总是可以触发 hasLayout，但是在 IE5.0 中不支持。 <br/>具有“layout” 的元素如果同时 display: inline ，那么它的行为就和标准中所说的 inline-block 很类似了：在段落中和普通文字一样在水平方向和连续排列，受 vertical-align 影响，并且大小可以根据内容自适应调整。这也可以解释为什么单单在 IE/Win 中内联元素可以包含块级元素而少出问题，因为在别的浏览器中 display: inline 就是内联，不像 IE/Win 一旦内联元素拥有 layout 还会变成 inline-block。<br/><br/><b><font size="4">haslayout 问题的调试与解决</font></b><br/>当网页在 IE 中有异常表现时，可以尝试激发 haslayout 来看看是不是问题所在。常用的方法是给某元素 css 设定 zoom:1 。使用 zoom:1 是因为大多数情况下，它能在不影响现有环境的条件下激发元素的 haslayout。而一旦问题消失，那基本上就可以判断是 haslayout 的原因。然后就可以通过设定相应的 css 属性来对这个问题进行修正了。建议首先要考虑的是设定元素的 width/height 属性，其次再考虑其他属性。<br/><br/>对 IE6 及更早版本来说，常用的方法被称为霍莉破解(Holly hack)，即设定这个元素的高度为 1% (height:1%;)。需要注意的是，当这个元素的 overflow 属性被设置为 visible 时，这个方法就失效了。或者使用 IE 的条件注释。<br/><br/>对 IE7 来说，最好的方法时设置元素的最小高度为 0 (min-height:0;)。<br/><br/>haslayout 问题引起的常见 bug<br/>IE6 及更低版本的双空白边浮动 bug<br/>bug 修复: display:inline;<br/><br/>IE5-6/win 的 3 像素偏移 bug<br/>bug 修复: _height:1%;<br/><br/>E6 的躲躲猫(peek-a-boo) bug<br/>bug 修复: _height:1%;<br/><br/>原文地址：http://www.iwanna.cn/archives/2009/08/18/2165/<br/>]]></description><category>前端</category><comments>http://www.sunthink.org/post/haslayout.html#comment</comments><wfw:comment>http://www.sunthink.org/</wfw:comment><wfw:commentRss>http://www.sunthink.org/feed.asp?cmt=19</wfw:commentRss><trackback:ping>http://www.sunthink.org/cmd.asp?act=tb&amp;id=19&amp;key=8b83be41</trackback:ping></item><item><title>HTML4默认样式</title><author>345411190@qq.com (admin)</author><link>http://www.sunthink.org/post/17.html</link><pubDate>Mon, 17 Aug 2009 14:26:24 +0800</pubDate><guid>http://www.sunthink.org/post/17.html</guid><description><![CDATA[&nbsp;&nbsp;&nbsp;这是w3c组织给出html4的样式建议，可惜浏览器们都加上自己的私有属性，让标准成了浮云。不过对于我们仍然是很有参考意义的。<br/>Appendix D. Default style sheet for HTML 4<br/>This appendix is informative, not normative.<br/><br/>This style sheet describes the typical formatting of all HTML 4 ([HTML4]) elements based on extensive research into current UA practice. Developers are encouraged to use it as a default style sheet in their implementations. <br/><br/>The full presentation of some HTML elements cannot be expressed in CSS 2.1, including replaced elements ("img", "object"), scripting elements ("script", "applet"), form control elements, and frame elements. <br/><br/>For other elements, the legacy presentation can be described in CSS but the solution removes the element. For example, the FONT element can be replaced by attaching CSS declarations to other elements (e.g., DIV). Likewise, legacy presentation of presentational attributes (e.g., the "border" attribute on TABLE) can be described in CSS, but the markup in the source document must be changed. <br/><br/>[CODE=css]html, address,<br/>blockquote,<br/>body, dd, div,<br/>dl, dt, fieldset, form,<br/>frame, frameset,<br/>h1, h2, h3, h4,<br/>h5, h6, noframes,<br/>ol, p, ul, center,<br/>dir, hr, menu, pre   { display: block }<br/>li              { display: list-item }<br/>head            { display: none }<br/>table           { display: table }<br/>tr              { display: table-row }<br/>thead           { display: table-header-group }<br/>tbody           { display: table-row-group }<br/>tfoot           { display: table-footer-group }<br/>col             { display: table-column }<br/>colgroup        { display: table-column-group }<br/>td, th          { display: table-cell }<br/>caption         { display: table-caption }<br/>th              { font-weight: bolder; text-align: center }<br/>caption         { text-align: center }<br/>body            { margin: 8px }<br/>h1              { font-size: 2em; margin: .67em 0 }<br/>h2              { font-size: 1.5em; margin: .75em 0 }<br/>h3              { font-size: 1.17em; margin: .83em 0 }<br/>h4, p,<br/>blockquote, ul,<br/>fieldset, form,<br/>ol, dl, dir,<br/>menu            { margin: 1.12em 0 }<br/>h5              { font-size: .83em; margin: 1.5em 0 }<br/>h6              { font-size: .75em; margin: 1.67em 0 }<br/>h1, h2, h3, h4,<br/>h5, h6, b,<br/>strong          { font-weight: bolder }<br/>blockquote      { margin-left: 40px; margin-right: 40px }<br/>i, cite, em,<br/>var, address    { font-style: italic }<br/>pre, tt, code,<br/>kbd, samp       { font-family: monospace }<br/>pre             { white-space: pre }<br/>button, textarea,<br/>input, select   { display: inline-block }<br/>big             { font-size: 1.17em }<br/>small, sub, sup { font-size: .83em }<br/>sub             { vertical-align: sub }<br/>sup             { vertical-align: super }<br/>table           { border-spacing: 2px; }<br/>thead, tbody,<br/>tfoot           { vertical-align: middle }<br/>td, th, tr      { vertical-align: inherit }<br/>s, strike, del  { text-decoration: line-through }<br/>hr              { border: 1px inset }<br/>ol, ul, dir,<br/>menu, dd        { margin-left: 40px }<br/>ol              { list-style-type: decimal }<br/>ol ul, ul ol,<br/>ul ul, ol ol    { margin-top: 0; margin-bottom: 0 }<br/>u, ins          { text-decoration: underline }<br/>br:before       { content: "\A"; white-space: pre-line }<br/>center          { text-align: center }<br/>:link, :visited { text-decoration: underline }<br/>:focus          { outline: thin dotted invert }<br/><br/>/* Begin bidirectionality settings (do not change) */<br/>BDO[DIR="ltr"]  { direction: ltr; unicode-bidi: bidi-override }<br/>BDO[DIR="rtl"]  { direction: rtl; unicode-bidi: bidi-override }<br/><br/>*[DIR="ltr"]    { direction: ltr; unicode-bidi: embed }<br/>*[DIR="rtl"]    { direction: rtl; unicode-bidi: embed }<br/><br/>@media print {<br/>  h1            { page-break-before: always }<br/>  h1, h2, h3,<br/>  h4, h5, h6    { page-break-after: avoid }<br/>  ul, ol, dl    { page-break-before: avoid }<br/>}[/CODE]<br/><br/><a href="http://www.w3.org/TR/CSS21/sample.html" target="_blank">Appendix D. Default style sheet for HTML 4</a><br/>]]></description><category>前端</category><comments>http://www.sunthink.org/post/17.html#comment</comments><wfw:comment>http://www.sunthink.org/</wfw:comment><wfw:commentRss>http://www.sunthink.org/feed.asp?cmt=17</wfw:commentRss><trackback:ping>http://www.sunthink.org/cmd.asp?act=tb&amp;id=17&amp;key=6a055a3d</trackback:ping></item><item><title>ie6的默认样式</title><author>345411190@qq.com (admin)</author><link>http://www.sunthink.org/post/16.html</link><pubDate>Mon, 17 Aug 2009 14:20:50 +0800</pubDate><guid>http://www.sunthink.org/post/16.html</guid><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp;这其实不是ie官方的文档，好像是别人经过实践搞出来的ie6的默认样式，这个对我们驯服ie6很有参考价值。你会从根本理解ie出现的那些bug的原因。不过可惜ie不像firefox哪样通过在地址栏输入命令来直接查看firefox的默认样式。<br/>[CODE=css]=======================================<br/>INTERNET EXPLORER 6 DEFAULT STYLE SHEET<br/>=======================================<br/><br/>****** HYPOTHETICAL *******************<br/><br/>This is a work in progress.<br/>Values are purely indicative.<br/>For any suggestion or addenda,<br/>please<br/>contact me.<br/><br/>[Back to CSS Test]<br/><br/>================================<br/><br/><br/>/* Standard HTML elements <br/>============================ <br/><br/>Compare with the default style sheet<br/>for HTML 4 (local copy).<br/>These values may be affected by the<br/>hasLayout property.<br/>We will not take in account  <br/>the frame and frameset elements.<br/>The table elements are not reviewed, due to<br/>the lack of support for the corresponding<br/>'display' values. */<br/>The uncertain values are marked with '<' and '>'.<br/><br/><br/>/* Block-level elements */<br/><br/>html, body,<br/>div, p,<br/>blockquote,<br/>ul, ol, dl,<br/>dt, dd, address,<br/>form, fieldset,<br/>frame, frameset,<br/>h1, h2, h3, h4,<br/>h5, h6, hr, pre {display: block;}<br/><br/>head {display: none;}<br/><br/>html {margin: 0;}<br/><br/>body {margin: 8px;}<br/><br/>div {margin: 0;}<br/><br/>p {margin: 1em 0;}<br/><br/>blockquote {margin: 1em 40px;}<br/><br/>ul {margin: 1em 0 1em 40px; list-style-type: disc;}<br/><br/>li {display: list-item;}<br/><br/>ol {margin: 1em 0 1em 40px; list-style-type: decimal;}<br/><br/>ul ul {margin: 0 0 0 40px; list-style-type: circle;}<br/><br/>ul ul ul {margin: 0 0 0 40px; list-style-type: square;}<br/><br/>dl {margin: 1em 0;}<br/>dd {margin-left: 40px;}<br/><br/>address {margin: 1em 0; font-style: italic;}<br/><br/>form, fieldset {margin: 0;}<br/><br/>fieldset {border: 1px inset <sistem color>;}<br/><br/>h1, h2, h3, h4, h5, h6 {font-weight: bold;}<br/><br/>/* the following  font size and vertical values are purely indicative,<br/>since they depend on the font size/family set on the<br/>BODY element */<br/><br/>h1 {font-size: 2em; margin: .6em 0;}<br/>h2 {font-size: 1.5em; margin: .8em 0;}<br/>h3 {font-size: 1.1em; margin: 1em 0; }<br/>h4 {font-size: 1em; margin: 1.3em 0;}<br/>h5 {font-size: 0.8em; margin: 1.6em 0;}<br/>h6 {font-size: 0.6em; margin: 2.3em 0;}<br/><br/>hr {border: 2px outset <sistem color>;}<br/><br/>pre {margin: 1em 0; font-family: monospace; white-space: pre;}<br/><br/><br/><br/><br/>/* Inline elements */<br/><br/>a, i, cite, em, var, acronym,<br/>tt, code, kdb, samp, del, ins,<br/>u, dfn, sub, sup, big, small {display: inline; }<br/><br/>a:link {color: blue; text-decoration: underline; }<br/>a:visited {color: purple; text-decoration: underline;}<br/><br/>i, cite, em, var {font-style: italic;}<br/><br/>tt, code, kbd, samp {font-family: monospace;}<br/><br/>del {text-decoration: line-through;}<br/>u, ins {text-decoration: underline;}<br/><br/>sub {<br/>vertical-align: sub; <br/>font-size: smaller; <br/>line-height: <value>;<br/>} /* greater than 'normal' */<br/><br/>sup {<br/>vertical-align: super; <br/>font-size: smaller; <br/>line-height: <value>;<br/>} /* less than 'normal' */<br/><br/>big {font-size: larger;}<br/><br/>small {font-size: smaller;}<br/><br/>/* Replaced elements */<br/><br/>/* We will take in account only INPUT and TEXTAREA */<br/><br/>input, textarea {display: inline-block;}[/CODE]<br/><br/><a href="http://gabrieleromanato.altervista.org/css-test/internet-explorer-6-default-style-sheet/index.html" target="_blank">IE6默认样式表(INTERNET EXPLORER 6 DEFAULT STYLE SHEET)</a>]]></description><category>前端</category><comments>http://www.sunthink.org/post/16.html#comment</comments><wfw:comment>http://www.sunthink.org/</wfw:comment><wfw:commentRss>http://www.sunthink.org/feed.asp?cmt=16</wfw:commentRss><trackback:ping>http://www.sunthink.org/cmd.asp?act=tb&amp;id=16&amp;key=e553ace2</trackback:ping></item><item><title>Firefox的默认样式</title><author>345411190@qq.com (admin)</author><link>http://www.sunthink.org/post/15.html</link><pubDate>Mon, 17 Aug 2009 14:01:43 +0800</pubDate><guid>http://www.sunthink.org/post/15.html</guid><description><![CDATA[虽然w3c制订了html的一些标准：浏览器们都会按照自己预定义的样式来解析渲染网页中的标签，firefox可以通过在地址栏里输入resource://gre/res/html.css的命令来得到firefox的默认样式表。要是ie也有这个命令该多好！你也可以在不同版本的firefox地址栏输入这个命令，这样就可以对比firefox不同版本的差异，这让我们在Reset CSS的时候有了重要的参考。<br/>[CODE=css]/* ***** BEGIN LICENSE BLOCK *****<br/> * Version: MPL 1.1/GPL 2.0/LGPL 2.1<br/> *<br/> * The contents of this file are subject to the Mozilla Public License Version<br/> * 1.1 (the "License"); you may not use this file except in compliance with<br/> * the License. You may obtain a copy of the License at<br/> * http://www.mozilla.org/MPL/<br/> *<br/> * Software distributed under the License is distributed on an "AS IS" basis,<br/> * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License<br/> * for the specific language governing rights and limitations under the<br/> * License.<br/> *<br/> * The Original Code is mozilla.org code.<br/> *<br/> * The Initial Developer of the Original Code is<br/> * Netscape Communications Corporation.<br/> * Portions created by the Initial Developer are Copyright (C) 1998<br/> * the Initial Developer. All Rights Reserved.<br/> *<br/> * Contributor(s):<br/> *   Blake Ross <BlakeR1234@aol.com><br/> *<br/> * Alternatively, the contents of this file may be used under the terms of<br/> * either of the GNU General Public License Version 2 or later (the "GPL"),<br/> * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),<br/> * in which case the provisions of the GPL or the LGPL are applicable instead<br/> * of those above. If you wish to allow use of your version of this file only<br/> * under the terms of either the GPL or the LGPL, and not to allow others to<br/> * use your version of this file under the terms of the MPL, indicate your<br/> * decision by deleting the provisions above and replace them with the notice<br/> * and other provisions required by the GPL or the LGPL. If you do not delete<br/> * the provisions above, a recipient may use your version of this file under<br/> * the terms of any one of the MPL, the GPL or the LGPL.<br/> *<br/> * ***** END LICENSE BLOCK ***** */<br/><br/>@namespace url(http://www.w3.org/1999/xhtml); /* set default namespace to HTML */<br/><br/>/* bidi */<br/><br/>[dir="rtl"] {<br/>  direction: rtl;<br/>  unicode-bidi: embed;<br/>}<br/>[dir="ltr"] {<br/>  direction: ltr;<br/>  unicode-bidi: embed;<br/>}<br/>bdo[dir] {<br/>  unicode-bidi: bidi-override;<br/>}<br/><br/>/* blocks */<br/><br/>html, div, map, dt, isindex, form {<br/>  display: block;<br/>}<br/><br/>body {<br/>  display: block;<br/>  margin: 8px;<br/>}<br/><br/>p, dl, multicol {<br/>  display: block;<br/>  margin: 1em 0;<br/>}<br/><br/>dd {<br/>  display: block;<br/>  -moz-margin-start: 40px;<br/>}<br/><br/>blockquote {<br/>  display: block;<br/>  margin: 1em 40px;<br/>}<br/><br/>address {<br/>  display: block;<br/>  font-style: italic;<br/>}<br/><br/>center {<br/>  display: block;<br/>  text-align: -moz-center;<br/>}<br/><br/>blockquote[type=cite] {<br/>  display: block;<br/>  margin: 1em 0px;<br/>  -moz-padding-start: 1em;<br/>  -moz-border-start: solid;<br/>  border-color: blue;<br/>  border-width: thin;<br/>}<br/><br/>span[_moz_quote=true] {<br/>  color: blue;<br/>}<br/><br/>pre[_moz_quote=true] {<br/>  color: blue;<br/>}<br/><br/>h1 {<br/>  display: block;<br/>  font-size: 2em;<br/>  font-weight: bold;<br/>  margin: .67em 0;<br/>}<br/><br/>h2 {<br/>  display: block;<br/>  font-size: 1.5em;<br/>  font-weight: bold;<br/>  margin: .83em 0;<br/>}<br/><br/>h3 {<br/>  display: block;<br/>  font-size: 1.17em;<br/>  font-weight: bold;<br/>  margin: 1em 0;<br/>}<br/><br/>h4 {<br/>  display: block;<br/>  font-weight: bold;<br/>  margin: 1.33em 0;<br/>}<br/><br/>h5 {<br/>  display: block;<br/>  font-size: 0.83em;<br/>  font-weight: bold;<br/>  margin: 1.67em 0;<br/>}<br/><br/>h6 {<br/>  display: block;<br/>  font-size: 0.67em;<br/>  font-weight: bold;<br/>  margin: 2.33em 0;<br/>}<br/><br/>listing {<br/>  display: block;<br/>  font-family: -moz-fixed;<br/>  font-size: medium;<br/>  white-space: pre;<br/>  margin: 1em 0;<br/>}<br/><br/>xmp, pre, plaintext {<br/>  display: block;<br/>  font-family: -moz-fixed;<br/>  white-space: pre;<br/>  margin: 1em 0;<br/>}<br/><br/>/* tables */<br/><br/>table {<br/>  display: table;<br/>  border-spacing: 2px;<br/>  border-collapse: separate;<br/>  margin-top: 0;<br/>  margin-bottom: 0;<br/>  /* XXXldb do we want this if we're border-collapse:collapse ? */<br/>  -moz-box-sizing: border-box;<br/>  text-indent: 0;<br/>}<br/><br/>table[align="left"] {<br/>  float: left;<br/>}<br/><br/>table[align="right"] {<br/>  float: right;<br/>  text-align: start;<br/>}<br/><br/>table[rules]:not([rules="none"]) {<br/>  border-collapse: collapse;<br/>}<br/>   <br/>/* caption inherits from table not table-outer */  <br/>caption {<br/>  display: table-caption;<br/>  text-align: center;<br/>  -moz-box-sizing: border-box;<br/>}<br/><br/>table[align="center"] > caption {<br/>  margin-left: auto;<br/>  margin-right: auto;<br/>}<br/><br/>table[align="center"] > caption[align="left"] {<br/>  margin-right: 0;<br/>}<br/><br/>table[align="center"] > caption[align="right"] {<br/>  margin-left: 0;<br/>}<br/><br/>tr {<br/>  display: table-row;<br/>  vertical-align: inherit;<br/>}<br/><br/>col {<br/>  display: table-column;<br/>}<br/><br/>colgroup {<br/>  display: table-column-group;<br/>}<br/><br/>tbody {<br/>  display: table-row-group;<br/>  vertical-align: middle;<br/>}<br/><br/>thead {<br/>  display: table-header-group;<br/>  vertical-align: middle;<br/>}<br/><br/>tfoot {<br/>  display: table-footer-group;<br/>  vertical-align: middle;<br/>}<br/><br/>/* for XHTML tables without tbody */<br/>table > tr {<br/>  vertical-align: middle;<br/>}<br/><br/>td { <br/>  display: table-cell;<br/>  vertical-align: inherit;<br/>  text-align: inherit; <br/>  padding: 1px;<br/>}<br/><br/>th {<br/>  display: table-cell;<br/>  vertical-align: inherit;<br/>  font-weight: bold;<br/>  padding: 1px;<br/>}<br/><br/>tr > form:-moz-is-html, tbody > form:-moz-is-html,<br/>thead > form:-moz-is-html, tfoot > form:-moz-is-html,<br/>table > form:-moz-is-html {<br/>  /* Important: don't show these forms in HTML */<br/>  display: none !important;<br/>}<br/><br/>/* inlines */<br/><br/>q:before {<br/>  content: open-quote;<br/>}<br/><br/>q:after {<br/>  content: close-quote;<br/>}<br/><br/>b, strong {<br/>  font-weight: bolder;<br/>}<br/><br/>i, cite, em, var, dfn {<br/>  font-style: italic;<br/>}<br/><br/>tt, code, kbd, samp {<br/>  font-family: -moz-fixed;<br/>}<br/><br/>u, ins {<br/>  text-decoration: underline;<br/>}<br/><br/>s, strike, del {<br/>  text-decoration: line-through;<br/>}<br/><br/>blink {<br/>  text-decoration: blink;<br/>}<br/><br/>big {<br/>  font-size: larger;<br/>}<br/><br/>small {<br/>  font-size: smaller;<br/>}<br/><br/>sub {<br/>  vertical-align: sub;<br/>  font-size: smaller;<br/>  line-height: normal;<br/>}<br/><br/>sup {<br/>  vertical-align: super;<br/>  font-size: smaller;<br/>  line-height: normal;<br/>}<br/><br/>nobr {<br/>  white-space: nowrap;<br/>}<br/><br/>/* titles */<br/>abbr[title], acronym[title] {<br/>  border-bottom: dotted 1px;<br/>}<br/><br/>/* lists */<br/><br/>ul, menu, dir {<br/>  display: block;<br/>  list-style-type: disc;<br/>  margin: 1em 0;<br/>  -moz-padding-start: 40px;<br/>}<br/><br/>ol {<br/>  display: block;<br/>  list-style-type: decimal;<br/>  margin: 1em 0;<br/>  -moz-padding-start: 40px;<br/>}<br/><br/>li {<br/>  display: list-item;<br/>}<br/><br/>/* nested lists have no top/bottom margins */<br/>ul ul,   ul ol,   ul dir,   ul menu,   ul dl,<br/>ol ul,   ol ol,   ol dir,   ol menu,   ol dl,<br/>dir ul,  dir ol,  dir dir,  dir menu,  dir dl,<br/>menu ul, menu ol, menu dir, menu menu, menu dl,<br/>dl ul,   dl ol,   dl dir,   dl menu,   dl dl {<br/>  margin-top: 0;<br/>  margin-bottom: 0;<br/>}<br/><br/>/* 2 deep unordered lists use a circle */<br/>ol ul,   ul ul,   menu ul,   dir ul,<br/>ol menu, ul menu, menu menu, dir menu,<br/>ol dir,  ul dir,  menu dir,  dir dir {<br/>  list-style-type: circle;<br/>}<br/><br/>/* 3 deep (or more) unordered lists use a square */<br/>ol ol ul,     ol ul ul,     ol menu ul,     ol dir ul,<br/>ol ol menu,   ol ul menu,   ol menu menu,   ol dir menu,<br/>ol ol dir,    ol ul dir,    ol menu dir,    ol dir dir,<br/>ul ol ul,     ul ul ul,     ul menu ul,     ul dir ul,<br/>ul ol menu,   ul ul menu,   ul menu menu,   ul dir menu,<br/>ul ol dir,    ul ul dir,    ul menu dir,    ul dir dir,<br/>menu ol ul,   menu ul ul,   menu menu ul,   menu dir ul,<br/>menu ol menu, menu ul menu, menu menu menu, menu dir menu,<br/>menu ol dir,  menu ul dir,  menu menu dir,  menu dir dir,<br/>dir ol ul,    dir ul ul,    dir menu ul,    dir dir ul,<br/>dir ol menu,  dir ul menu,  dir menu menu,  dir dir menu,<br/>dir ol dir,   dir ul dir,   dir menu dir,   dir dir dir {<br/>  list-style-type: square;<br/>}<br/><br/><br/>/* leafs */<br/><br/>/* <hr> noshade and color attributes are handled completely by<br/> * the nsHTMLHRElement attribute mapping code<br/> */<br/>hr {<br/>  display: block;<br/>  height: 2px;<br/>  border: 1px inset;<br/>  margin: 0.5em auto 0.5em auto;<br/>  color: gray;<br/>  -moz-float-edge: margin-box;<br/>  -moz-box-sizing: border-box;<br/>}<br/><br/>hr[size="1"] {<br/>  border-style: solid none none none;<br/>}<br/><br/>*|*:-moz-any-link img, img[usemap], object[usemap] {<br/>  border: 2px solid;<br/>}<br/><br/>img:-moz-broken::before, input:-moz-broken::before,<br/>img:-moz-user-disabled::before, input:-moz-user-disabled::before,<br/>img:-moz-loading::before, input:-moz-loading::before,<br/>applet:-moz-empty-except-children-with-localname(param):-moz-broken::before,<br/>applet:-moz-empty-except-children-with-localname(param):-moz-user-disabled::before {<br/>  content: -moz-alt-content !important;<br/>  unicode-bidi: embed;<br/>}<br/><br/>object:-moz-broken > *|*, applet:-moz-broken > *|*<br/>object:-moz-user-disabled > *|*, applet:-moz-user-disabled > *|* {<br/>  /*<br/>    Inherit in the object's alignment so that if we aren't aligned explicitly<br/>    we'll end up in the right place vertically.  See bug 36997.  Note that this<br/>    is not !important because we _might_ be aligned explicitly.<br/>  */<br/>  vertical-align: inherit;<br/>}<br/><br/>img:-moz-suppressed, input:-moz-suppressed, object:-moz-suppressed,<br/>embed:-moz-suppressed, applet:-moz-suppressed {<br/>  /*<br/>    Set visibility too in case the page changes display.  Note that we _may_<br/>    want to just set visibility and not display, in general, if we find that<br/>    display:none breaks too many layouts.  And if we decide we really do want<br/>    people to be able to right-click blocked images, etc, we need to set<br/>    neither one, and hack the painting code.... :(<br/>   */<br/>  display: none !important;<br/>  visibility: hidden !important;<br/>}<br/><br/>img[usemap], object[usemap] {<br/>  color: blue;<br/>}<br/><br/>frameset {<br/>  display: block ! important;<br/>  overflow: -moz-hidden-unscrollable;<br/>  position: static ! important;<br/>  float: none ! important;<br/>  border: none ! important;<br/>}<br/><br/>frame {<br/>  border: none ! important;<br/>}<br/><br/>iframe {<br/>  border: 2px inset;<br/>}<br/><br/>noframes {<br/>  display: none;<br/>}<br/><br/>spacer {<br/>  position: static ! important;<br/>  float: none ! important;<br/>}<br/><br/>canvas {<br/>  -moz-user-select: none;<br/>}<br/><br/>/* focusable content: anything w/ tabindex >=0 is focusable */<br/>abbr:focus, acronym:focus, address:focus, applet:focus, b:focus, <br/>base:focus, big:focus, blockquote:focus, br:focus, canvas:focus, caption:focus,<br/>center:focus, cite:focus, code:focus, col:focus, colgroup:focus, dd:focus,<br/>del:focus, dfn:focus, dir:focus, div:focus, dl:focus, dt:focus, em:focus,<br/>fieldset:focus, font:focus, form:focus, h1:focus, h2:focus, h3:focus, h4:focus,<br/>h5:focus, h6:focus, hr:focus, i:focus, img:focus, ins:focus, <br/>kbd:focus, label:focus, legend:focus, li:focus, link:focus, menu:focus, <br/>object:focus, ol:focus, p:focus, pre:focus, q:focus, s:focus, samp:focus, <br/>small:focus, span:focus, strike:focus, strong:focus, sub:focus, sup:focus, <br/>table:focus, tbody:focus, td:focus, tfoot:focus, th:focus, thead:focus, <br/>tr:focus, tt:focus, u:focus, ul:focus, var:focus {<br/>  /* Don't specify the outline-color, we should always use initial value. */<br/>   outline: 1px dotted;<br/>}<br/><br/>/* hidden elements */<br/>area, base, basefont, head, meta, script, style, title,<br/>noembed, param {<br/>   display: none;<br/>}<br/><br/>/* emulation of non-standard HTML <marquee> tag */<br/>marquee {<br/>  width: -moz-available;<br/>  display: inline-block;<br/>  vertical-align: text-bottom;<br/>  text-align: start;<br/>  -moz-binding: url('chrome://xbl-marquee/content/xbl-marquee.xml#marquee-horizontal');<br/>}<br/><br/>marquee[direction="up"], marquee[direction="down"] {<br/>  -moz-binding: url('chrome://xbl-marquee/content/xbl-marquee.xml#marquee-vertical');<br/>  height: 200px;<br/>}<br/><br/>/* PRINT ONLY rules follow */<br/>@media print {<br/><br/>  marquee { -moz-binding: none; }<br/><br/>  /* XXX this should not be necessary, we should be stopping blinking<br/>     of any kind in print preview, not just the <blink> element */<br/>  blink {<br/>    text-decoration: none;<br/>  }<br/> <br/>}[/CODE]]]></description><category>前端</category><comments>http://www.sunthink.org/post/15.html#comment</comments><wfw:comment>http://www.sunthink.org/</wfw:comment><wfw:commentRss>http://www.sunthink.org/feed.asp?cmt=15</wfw:commentRss><trackback:ping>http://www.sunthink.org/cmd.asp?act=tb&amp;id=15&amp;key=c36a242a</trackback:ping></item></channel></rss>
