都是以前忽略的,感谢 lifesinger
http://lifesinger.org/blog/2009/08/yahooooo/
var YAHOO = 2; YAHOO.util = {}; alert(YAHOO.util); // => undefined
注意 javascript primitive value 的自动封箱特性,执行 YAHOO.util={}; 时生成临时数字对象,util作为他的属性,完了临时对象也没了,下次 alert(YAHOO.util) 是另外一个临时对象,和 java 的 autobox 有点像.
http://lifesinger.org/blog/2009/08/line-height/
<!doctype html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>line-height</title>
</head>
<body>
<div style="font: 12px Tahoma,sans-serif; width: 400px">
<hr />
<p style="line-height: 150%">line-height: 150% - The quick brown fox jumps over the lazy dog. The quick brown fox <span style="font-size: 52px">jumps over</span> the lazy dog. The quick brown <span style="font-size: 52px">fox jumps</span> over the lazy dog.</p>
<hr />
<p style="line-height: 1.5">line-height: 1.5 - The quick brown fox jumps over the lazy dog. The quick brown fox <span style="font-size: 52px">jumps over</span> the lazy dog. The quick brown <span style="font-size: 52px">fox jumps</span> over the lazy dog.</p>
<hr />
</div>
</body>
</html>
效果:
解答:
line-height 取值解释:
em ex % 是继承包含块计算后的数值,
数字是在自己的 font-size 上乘了该数字(或继承的数字)得到数值.