<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:wfw="http://wellformedweb.org/CommentAPI/">
  <channel>
    <title><![CDATA[CSS NOTEPAD]]></title> 
    <link>http://www.nenten.cn/</link> 
    <description><![CDATA[A Place for Expression]]></description> 
    <language>en</language> 
    <copyright><![CDATA[Copyright 2008, CSS NOTEPAD]]></copyright> 
    <webMaster><![CDATA[null@null.com (Unknown)]]></webMaster> 
    <generator>LBS v2.0.313</generator> 
    <pubDate>Wed, 19 Nov 2008 21:43:56 +0800</pubDate> 
    <ttl>60</ttl>
  
    <item>
      <title><![CDATA[为什么网页中英文和数字显示为斜体]]></title> 
      <link><![CDATA[http://www.nenten.cn/article.asp?id=18]]></link> 
      <category><![CDATA[other]]></category> 
      <author><![CDATA[hoosin <null@null.com>]]></author> 
      <pubDate>Fri, 07 Nov 2008 11:37:25 +0800</pubDate> 
      <description><![CDATA[今天一个同事碰到过这个问题<br /><br />其它同事浏览都正确<br /><br />只有他在浏览网页时，一些网页的英文显示为斜体。<br /><br />我打开他的浏览器发现浏览verdana定义的英文都显示正确。<br /><br />arial字体定义时就不正确<br /><br />初步判断为arial字体已经损坏<br /><br />安装arial字体之后，问题解决。]]></description>
      <wfw:commentRss><![CDATA[http://www.nenten.cn/feed.asp?q=comment&id=18]]></wfw:commentRss>
    </item>
      
    <item>
      <title><![CDATA[那个css文档已经落后了]]></title> 
      <link><![CDATA[http://www.nenten.cn/article.asp?id=17]]></link> 
      <category><![CDATA[other]]></category> 
      <author><![CDATA[hoosin <null@null.com>]]></author> 
      <pubDate>Tue, 04 Nov 2008 15:05:36 +0800</pubDate> 
      <description><![CDATA[苏小雨版的那个css文档已经落后了<br />但目前只能搜索到他的css帮助文档<br />需要大量时间去修改，把一些已经没用的语句给去掉。]]></description>
      <wfw:commentRss><![CDATA[http://www.nenten.cn/feed.asp?q=comment&id=17]]></wfw:commentRss>
    </item>
      
    <item>
      <title><![CDATA[px与pt的区别]]></title> 
      <link><![CDATA[http://www.nenten.cn/article.asp?id=16]]></link> 
      <category><![CDATA[other]]></category> 
      <author><![CDATA[hoosin <null@null.com>]]></author> 
      <pubDate>Sun, 02 Nov 2008 20:52:37 +0800</pubDate> 
      <description><![CDATA[<pre>
基本概念:
px就是表示pixel，像素，是屏幕上显示数据的最基本的点；
pt就是point，是印刷行业常用单位，等于1/72英寸。 

这样很明白，px是一个点，它不是自然界的长度单位，谁能说出一个“点”有多长多大么？
可以画的很小，也可以很大。如果点很小，那画面就清晰，我们称它为“分辨率高”，反之，
就是“分辨率低”。所以，“点”的大小是会“变”的，也称为“相对长度”。 

pt全称为point，但中文不叫“点”，查金山词霸可以看到，确切的说法是一个专用的印刷单位
“磅”，大小为1/72英寸。所以它是一个自然界标准的长度单位，也称为“绝对长度”。 

因此就有这样的说法，在网页设计中，pixel是相对大小，而point是绝对大小。 

但这种说法其实还是有问题，先来看看下面的例子： 

<span style="font-size:72px;">文字72px</span> 

<span style="font-size:72pt;">文字72pt </span>

<span style="font-size:96px;">文字96px </span>

看出什么名堂了么？ 

72px要比72pt小一些，但96px正好和72pt一样大小 

让我们来调整电脑的设置：
在桌面上右键 > 属性 > settings > Advanced > General > DPI setting > 96 DPI。 

试着改变设置，设为72DPI，重启，再打开浏览器看：72px已经等同于72pt了。为什么？ 

还是再做个实验：分别用800×600和1024×768看刚才的例子，明显高分辨率下，文字就变小。
而且，关键的是，无论用px还是pt，都会变小。pt并没有如有些人所说，是“绝对”的，“固定”的。 

但如果用打印机把这页面打印出来，就可以看到：无论屏幕用什么分辨率，打印出来大小都是一样的（这是当然的）。 

首先要分清“屏幕效果”和“打印效果”这两个概念。 

在浏览网页过程中，所有的“大”“小”概念，都是基于“屏幕”这个“界面”上。“屏幕”上的各
种信息，包括文字、图片、表格等等，都会随屏幕的分辨率变化而变化，一个100px宽度大小的图片
，在800×600分辨率下，要占屏幕宽度的1/8，但在1024×768下，则只占约1/10。所以如果在定义
字体大小时，使用px作为单位，那一旦用户改变显示器分辨率从800到1024，用户实际看到的文字就
要变“小”（自然长度单位），甚至会看不清，影响浏览。 

那是不是用pt做单位就没这样的问题呢？错！问题同样出现。刚才的例子已经很清楚的说明，在不
同分辨率下，无论是px还是pt，都会改变大小 。以现在的电脑屏幕情况，还没有一种单位可以保
证，在不同分辨率下，一个文字大小可以“固定不变”。因为这很难以实现也不是很有必要：
全球电脑用户以亿来数，屏幕从14寸到40寸甚至更高都有，屏幕大小不同，分辨率也不同，
要保证一个字体在所有用户面前大小一样，实在是MISSION IMPOSSIBLE。另外，电脑有
其自身的调节性，用户可以自己来调节：1）在浏览器中调节字体大小；2）在刚才提到的显示属性里调节。 

那在页面设计中到底是用px还是pt呢？ 

我认为，这个并没有什么原则性差异，就看自己处于什么角度思考了。 

Mac机怎么情况不清楚，在Windows里，默认的显示设置中，把文字定义为96DPI（PPI，
微软都将DPI和PPI混为一体，我们也就无须较真了）。这样的定义，说明了：1px＝1/96英寸。
联系pt的概念，1pt＝1/72英寸，可以得出，在这样的设置中，1px＝0.75pt，
常见的宋体9pt＝12px。在显示器分辨率不变的基础上（比如现在常用的1024×768），
1px大小也就固定不变，改变显示设置，调整为144DPI，可以得出，1px＝0.5pt，
常见的宋体9pt＝18px。原先用12px来组成的一个文字，现在需要18px来组成，
px多了，文字就“大”了，更易阅读了。 

所以，px和pt的使用区别，只有当用户改变默认的96DPI下才会产生：使用px定义文字，
无论用户怎么设置，都不会改变大小；使用pt定义文字，当用户设置超过96DPI的值，数值越大，字体就越大。 

（附公式：px = pt * DPI / 72) 

对了，刚才还提到改变浏览器中文字大小的选项，也可以改变网页的文字大小。
但在这种情况下，使用px和pt都是无效的，因为这2个都是有实际“pixel”数值的单位，
比如9pt是12px，大小固定。这里要引用新的单位：em，其实就是％。
因为当网页中的字体没有给出实际的px或pt定义的话，会有一个默认值：12pt即16px，
对应浏览器中“字体大小”中的“中等”，以这个为标准，变大或缩小。
（只适用于IE，在FF中，即便定义px或pt也都可以变大变小） 

所以，从这个概念上看，em才是真正的“相对单位”（百分比嘛，当然是相对），
而px和pt都是绝对单位（都有固定值）。 ]]></description>
      <wfw:commentRss><![CDATA[http://www.nenten.cn/feed.asp?q=comment&id=16]]></wfw:commentRss>
    </item>
      
    <item>
      <title><![CDATA[网上那个css2.1合法检测根本就不可靠]]></title> 
      <link><![CDATA[http://www.nenten.cn/article.asp?id=15]]></link> 
      <category><![CDATA[other]]></category> 
      <author><![CDATA[hoosin <null@null.com>]]></author> 
      <pubDate>Sat, 01 Nov 2008 14:10:11 +0800</pubDate> 
      <description><![CDATA[<a href="http://jigsaw.w3.org/css-validator/validator?" title="http://jigsaw.w3.org/css-validator/validator?" target="_blank">http://jigsaw.w3.org/css-validator/validator?</a><br />这个所谓的是否符合css2.1标准检测真是标准吗？我们来做个测试<br /><br /><b>浏览器地址栏里输入</b><br /><a href="http://jigsaw.w3.org/css-validator/validator?uri=http://www.yahoo.com" title="http://jigsaw.w3.org/css-validator/validator?uri=http://www.yahoo.com" target="_blank">http://jigsaw.w3.org/css-validator/validator?uri=http://www.yahoo.com</a><br /><br /><b>检测结果：没任何css错误。</b><br /><br />我把yahoo源代码复制一下，另存为一个test.html<br />然后放到<a href="http://www.neten.cn/test.html" title="http://www.neten.cn/test.html" target="_blank">http://www.neten.cn/test.html</a><br /><br />测试<br /><a href="http://jigsaw.w3.org/css-validator/validator?uri=http://www.neten.cn/test.html" title="http://jigsaw.w3.org/css-validator/validator?uri=http://www.neten.cn/test.html" target="_blank">http://jigsaw.w3.org/css-validator/validator?uri=http://www.neten.cn/test.html</a><br /><b><br />检测结果：300多css错误。</b><br /><br />那么只有一种可能：<br /><span style="color:Red">这个网站，已经把yahoo列入合法名单里面。根本没有按他原有的标准检测。<br />yahoo的css代码非常多，他竟然一下子就检测完了，速度非常快。<br />除了他潜规则默认yahoo合法之外，没有其它解释了。</span><br /><br /><b>教训</b><br />编写一些css代码需要去自己测试结果，这样对一些css用法印象就特别深刻。<br />不要听信偏信，不要被某些人所谓的标准蒙蔽双眼。<br /><br /><b>号外：</b><br />大家输入看看<br /><a href="http://jigsaw.w3.org/css-validator/validator?uri=www.qq.com" title="http://jigsaw.w3.org/css-validator/validator?uri=www.qq.com" target="_blank">http://jigsaw.w3.org/css-validator/validator?uri=www.qq.com</a><br />测试结果：直接报错无法打开页面]]></description>
      <wfw:commentRss><![CDATA[http://www.nenten.cn/feed.asp?q=comment&id=15]]></wfw:commentRss>
    </item>
      
    <item>
      <title><![CDATA[IE浏览器查看文字大小的设置及兼容问题]]></title> 
      <link><![CDATA[http://www.nenten.cn/article.asp?id=14]]></link> 
      <category><![CDATA[other]]></category> 
      <author><![CDATA[hoosin <null@null.com>]]></author> 
      <pubDate>Sat, 01 Nov 2008 12:57:23 +0800</pubDate> 
      <description><![CDATA[<pre><h2>举例：</h2>
我们要把IE器默认的字体大小<code>中</code>改成<code>较小</code>

<code>body{font-size:13px;*font-size:small;*font:x-small;}</code>

font-size:13px;/*for IE   8*/
*font-size:small;/*for IE5.5+*/
*font:x-small;/*for IE 5.5*/

IE8无法实别*号，所以要单独设置。(firefox也无法实别*选择符)
IE6.0 IE7.0能实别 *font-size 不能实别*font
IE5.5能实别*font  *font-size

在IE5.5中字号比IE6.0 IE7.0字号要大一级，所以设置成x-small;

</pre>]]></description>
      <wfw:commentRss><![CDATA[http://www.nenten.cn/feed.asp?q=comment&id=14]]></wfw:commentRss>
    </item>
      
    <item>
      <title><![CDATA[关于IETester字体大小设置问题]]></title> 
      <link><![CDATA[http://www.nenten.cn/article.asp?id=13]]></link> 
      <category><![CDATA[other]]></category> 
      <author><![CDATA[hoosin <null@null.com>]]></author> 
      <pubDate>Sat, 01 Nov 2008 12:52:41 +0800</pubDate> 
      <description><![CDATA[<b>问题</b><br />当IE查看文字大小改变之后<br />要想在IEtester看到效果时，必须把IEtester重启才能生效。<br /><br />软件不完善啊，看来IEtester应该加入设置字体大小功能。<br />方便制作人员测试。]]></description>
      <wfw:commentRss><![CDATA[http://www.nenten.cn/feed.asp?q=comment&id=13]]></wfw:commentRss>
    </item>
      
    <item>
      <title><![CDATA[关于web developer 安装不成功的问题]]></title> 
      <link><![CDATA[http://www.nenten.cn/article.asp?id=12]]></link> 
      <category><![CDATA[other]]></category> 
      <author><![CDATA[hoosin <null@null.com>]]></author> 
      <pubDate>Sat, 01 Nov 2008 11:13:37 +0800</pubDate> 
      <description><![CDATA[今天下载了一个web developer在家里竟然安装不了<br />firefox3.03提醒我这个插件没有提供安全更新。<br />连续下载了几个都没用<br /><br />最后面firefox官网下载的才安装成功<br /><a href="https://addons.mozilla.org/en-US/firefox/addon/60" title="https://addons.mozilla.org/en-US/firefox/addon/60" target="_blank">https://addons.mozilla.org/en-US/firefox/addon/60</a>]]></description>
      <wfw:commentRss><![CDATA[http://www.nenten.cn/feed.asp?q=comment&id=12]]></wfw:commentRss>
    </item>
      
    <item>
      <title><![CDATA[div 图片垂直居中问题]]></title> 
      <link><![CDATA[http://www.nenten.cn/article.asp?id=11]]></link> 
      <category><![CDATA[css2.1]]></category> 
      <author><![CDATA[hoosin <null@null.com>]]></author> 
      <pubDate>Fri, 31 Oct 2008 11:39:09 +0800</pubDate> 
      <description><![CDATA[<pre>
网上有一个例子其中hack IE代码有一个display:block
测试过程中他没有用处
<b>1.图片高度问题</b> 
图片的高度奇偶性会影响真正居中，上下相差1px.不过在实际应用中没啥影响。
当图片高度为偶数时 <code>*font-size:175px</code>
当图片高度为奇数时 <code>*font-size:176px</code>
</pre>
<br/>
<br/>
    <table width="600" border="0" cellpadding="0" cellspacing="1" bgcolor="#333333">
    <tr>
      <td width="47" height="30" align="center" bgcolor="#FFFFFF">&nbsp;</td>
      <td width="59" align="center" bgcolor="#FFFFFF"><strong>IE5.5</strong></td>
      <td width="64" align="center" bgcolor="#FFFFFF"><strong>IE6.0 </strong></td>
      <td width="66" align="center" bgcolor="#FFFFFF"><strong>IE7.0 </strong></td>
      <td width="92" align="center" bgcolor="#FFFFFF"><strong>IE8.0
          beta2 </strong></td>
      <td width="122" align="center" bgcolor="#FFFFFF"><strong>Firefox3.03</strong></td>
      <td width="142" align="center" bgcolor="#FFFFFF">&nbsp;</td>
    </tr>
    <tr>
      <td height="30" align="center" bgcolor="#FFFFFF"><b>&nbsp;</b></td>
      <td align="center" bgcolor="#FFFFFF">√</td>
      <td align="center" bgcolor="#FFFFFF">√</td>
      <td align="center" bgcolor="#FFFFFF">√</td>
      <td align="center" bgcolor="#FFFFFF">√</td>
      <td align="center" bgcolor="#FFFFFF">√</td>
      <td align="center" bgcolor="#FFFFFF">√测试通过</td>
    </tr>
  </table>
<br/>
<br/>
<textarea rows="10" cols="90" name="runcode0">
	<style type="text/css" media="screen">           
.box {      
    display: table-cell;  /*for IE8、 Firefox */    
    vertical-align:middle;      
    width:950px;      
    height:200px;      
    text-align:center;   
    *font-size:175px;    /*for ie   sub  IE8*/        
   
    border: 1px solid #eee;      
}      
.box img {      
    vertical-align:middle;   border:1px solid #f00; /* border for test height*/  
}      
</style>
    <div class="box"><img src="http://www.neten.cn/styles/default/images/rss.png"></div>
</textarea><br/>
<INPUT onclick="runEx('runcode0')" type="button" value="runcode"/>
<INPUT onclick="doCopy(runcode0)" type="button" value="copycode"/> 
<INPUT onclick="doSave(runcode0)" type="button" value="savecode"/>]]></description>
      <wfw:commentRss><![CDATA[http://www.nenten.cn/feed.asp?q=comment&id=11]]></wfw:commentRss>
    </item>
      
    <item>
      <title><![CDATA[只能输入数字的简单脚本]]></title> 
      <link><![CDATA[http://www.nenten.cn/article.asp?id=10]]></link> 
      <category><![CDATA[javascript]]></category> 
      <author><![CDATA[hoosin <null@null.com>]]></author> 
      <pubDate>Tue, 28 Oct 2008 15:20:42 +0800</pubDate> 
      <description><![CDATA[<pre>
在下面输入框输输字母看看
<input onkeyup="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D/g,'')"> 

这里用到了正则表达式\d<code>匹配一个数字字符。等价于 [0-9]。</code>

<textarea rows="10" cols="90" name="runcode0">
  <input onkeyup="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D/g,'')"> 
</textarea>
<INPUT onclick="runEx('runcode0')" type="button" value="runcode"/> <INPUT onclick="doCopy(runcode0)" type="button" value="copycode"/> <INPUT onclick="doSave(runcode0)" type="button" value="savecode"/>
</pre>]]></description>
      <wfw:commentRss><![CDATA[http://www.nenten.cn/feed.asp?q=comment&id=10]]></wfw:commentRss>
    </item>
      
    <item>
      <title><![CDATA[input:focus]]></title> 
      <link><![CDATA[http://www.nenten.cn/article.asp?id=9]]></link> 
      <category><![CDATA[css2.1]]></category> 
      <author><![CDATA[hoosin <null@null.com>]]></author> 
      <pubDate>Sat, 25 Oct 2008 21:32:40 +0800</pubDate> 
      <description><![CDATA[<pre><code>
input.text:focus{border:1px solid #8B4D11; background:#F3CAA2}
</code>
当class为text的输入框聚焦时，改变样式.<pre/>
<table width="600" border="0" cellpadding="0" cellspacing="1" bgcolor="#333333">
    <tr>
      <td width="47" height="30" align="center" bgcolor="#FFFFFF">&nbsp;</td>
      <td width="59" align="center" bgcolor="#FFFFFF"><strong>IE5.5</strong></td>
      <td width="64" align="center" bgcolor="#FFFFFF"><strong>IE6.0 </strong></td>
      <td width="66" align="center" bgcolor="#FFFFFF"><strong>IE7.0 </strong></td>
      <td width="92" align="center" bgcolor="#FFFFFF"><strong>IE8.0
          beta2 </strong></td>
      <td width="122" align="center" bgcolor="#FFFFFF"><strong>Firefox3.03</strong></td>
      <td width="142" align="center" bgcolor="#FFFFFF">&nbsp;</td>
    </tr>
    <tr>
      <td height="30" align="center" bgcolor="#FFFFFF"><b>&nbsp;</b></td>
      <td align="center" bgcolor="#FFFFFF">×</td>
      <td align="center" bgcolor="#FFFFFF">×</td>
      <td align="center" bgcolor="#FFFFFF">×</td>
      <td align="center" bgcolor="#FFFFFF">√</td>
      <td align="center" bgcolor="#FFFFFF">√</td>
      <td align="center" bgcolor="#FFFFFF">×不支持√支持</td>
    </tr>
  </table>]]></description>
      <wfw:commentRss><![CDATA[http://www.nenten.cn/feed.asp?q=comment&id=9]]></wfw:commentRss>
    </item>
      
  </channel>
</rss>
