好得很程序员自学网

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

line-height属性值为百分比和数字乘积因子的区别_html/css_WEB-ITnose

line-height属性值为百分比和数字乘积因子的区别:
本章节不对line-height属性的具体用法做介绍,只介绍参数为百分比和数字乘积因子时候的区别。
关于line-height的基本用法可以参阅line-height属性深入介绍一章节。
当设置line-height属性值为百分比和数字乘积因子的时候有点类似,比如200%和2都可以将line-height属性值设置为当前元素内字体大小的两倍,是不是感觉使用两种方式参数值有点多此一举,其实并非如此。
看如下代码实例:

      蚂蚁部落  #top{  width:300px;  background:#CCC;  line-height:2;  font-size:12px;  margin:5px;}#top .inner{  font-size:18px;}#bottom{  width:300px;  background:#CCC;  line-height:200%;  font-size:12px;  margin:5px;}#bottom .inner{  font-size:18px;}   

蚂蚁部落一

查看更多关于line-height属性值为百分比和数字乘积因子的区别_html/css_WEB-ITnose的详细内容...

  阅读:35次