好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

<font>周边知识点_html/css_WEB-ITnose

em

  1em = 元素自身设定的或是父元素继承的font-size值

1 

left margin = 24px

2

left margin = 18px

3

left margin = 12px

1 h1{font-size:24px;}2 h2{font-size:18px;}3 p{font-size:12px;}4 h1,h2,p{margin-left:1em;} 

font-weight

   值100~900并没有固定的加粗度,一般与某个变形名等价,400对应normal,700对应bold,其他视关键字情况而定。

Times假想加粗指定

字体 指定关键字 指定数字 TimesRegular normal 100,200,300,400 TimesBold bold 500,600,700,800,900

bolder 根据父元素加粗

1 p{font-weight:normal;}/*400,更粗是bold对应700,其中最小值为700*/2 p em{font-weight:bolder;}/*700*/3 4 h1{font-weight:bold;}/*700,更粗假设没有关键字,则设置为下一个更大的数字,最大为900*/5 h1 b{font-weight:bolder;}/*800*/ 

font-size

  无指定数字,初始值为medium。larger类似bolder根据父元素按缩放因子上移,但无绝对大小范围(900)限制。

  百分比也是按照父元素继承的大小来计算。

  这些继承是一级一级的,嵌套越里积累越多。 

  使用px则是给字体固定值,这样有个隐患即在IE6前用户无法调整文本大小,所以字体大小使用关键字和百分数会更好。 

text-indent

   文本缩进也会继承。

1  2     #demo{text-indent:3%;}3   

1 

2 This is the first line.3

This is the second line while this will also
get the text indent style.

4

查看更多关于<font>周边知识点_html/css_WEB-ITnose的详细内容...

  阅读:34次