文章来源:

  http://www.zhihu.com/question/20394889

总结:

  1、line-height:2em、line-height:200%

     根据父元素的字体大小计算行高

子元素继承父元素计算后的行高,如果子元素的字体很大,而父元素字体小,这样计算出来的行高有可能无法容量子元素的显示,会被截掉。

2、line-height:2(推荐)

      根据子元素计算行高(取最大字体值*2)

line-height:2、line-height:2em、line-height:200%的区别的更多相关文章

  1. 【IntellJ IDEA】idea启动测试类报错Error running 'Test1.test': Command line is too long. Shorten command line for Test1.test or also for JUnit default configuration.

    idea启动测试类报错 Error running 'Test1.test': Command line is too long. Shorten command line for Test1.tes ...

  2. Error running 'xxx': Command line is too long. Shorten command line for xxx

    跑单元测试时,报错如下: Error running 'xxx': Command line is too long. Shorten command line for xxx 解决方案: 在项目所在 ...

  3. IDEA命令行缩短器助你解决此问题:Command line is too long. Shorten command line...

    生命太短暂,不要去做一些根本没有人想要的东西.本文已被 https://www.yourbatman.cn 收录,里面一并有Spring技术栈.MyBatis.JVM.中间件等小而美的专栏供以免费学习 ...

  4. JS通过getBoundingClientRect获取的height可能与css设置的height不一致

    发现如果DOM元素有padding-top或者padding-bottom值时, $(dom).height() = dom.style.display + padding-top + padding ...

  5. Ecshop出现问题 includes\lib_main.php on line 1329 includes\lib_base.php on line

    php 5.3版本兼容问题不少,以上函数参数传递问题可以将lib_main.php on line 1329这句 $ext = end(explode('.', $tmp)); 改为 : $extsu ...

  6. d3.svg.line()错误:TypeError: d3.svg.line is not a function

    var line_generator= d3.svg.line() .x(function (d,i) { return i; }) .y(function (d) { return d; }) 错误 ...

  7. offset[Parent/Width/Height/Top/Left] 、 client[Width/Height/Top/Left] 、 Element.getBoundingClientRect()

    开篇提示:以下内容都经个人测试,参考API文档总结,但还是不能保证完全正确,若有错误,还请留言指出___________________________________________________ ...

  8. 转:Canvas标签的width和height以及style.width和style.height的区别

    转自:http://www.cnblogs.com/artwl/archive/2012/02/28/2372042.html 作者:Artwl 背景 今天在博问中看到一个问题:用canvas 的 l ...

  9. 将一个文件中的内容,在另一个文件中生成. for line in f1, \n f2.write(line)

    将一个文件中的内容,在另一个文件中生成. 核心语句: for line in f1: f1中的所有一行 f2.write(line)                                  ...

随机推荐

  1. LightOJ 1030 Discovering Gold

    期望,$dp$. 设$ans[i]$为$i$为起点,到终点$n$获得的期望金币值.$ans[i]=(ans[i+1]+ans[i+2]+ans[i+3]+ans[i+4]+ans[i+5]+ans[i ...

  2. liunx系统磁盘满的时候如何排查

    第一步:查看磁盘总体情况 命令: df -lh 可以看出/dev/vda1, 不过这是个设备的名称不是对应的目录,其实/dev/vda1设备对应的目录名称是/home下面 或者可以全局搜索哪个目录下面 ...

  3. MemoryStream和FileStream

    一,FileStream对象的数据来自文件,而MemoryStream对象的数据来自内存缓冲区.这两个类都继承自Stream类. 二,抽象基类System.IO.Stream代表流,它提供Read和W ...

  4. 【完全背包】HDU 4508 湫湫系列故事——减肥记I

    Time Limit : 3000/1000ms (Java/Other)   Memory Limit : 65535/32768K (Java/Other) Total Submission(s) ...

  5. Attribute value is quoted with " which must be escaped when used within the value 问题解决

    访问JSP时,报错:Attribute value is quoted with " which must be escaped when used within the value .相信 ...

  6. MATLAB的符号运算基础

    在数学运算中,运算的结果如果是一个数值,可以称这类运算为数值运算:如果运算结果为表达式,在MATLAB中称为符号运算,符号计算是对未赋值的符号对象(可以是常数.变量.表达式)进行运算和处理.MATLA ...

  7. IPython与notebook 安装

    基于 python2.7.13 32-bit版本安装 1.安装pyreadline https://pypi.python.org/pypi/pyreadline 下载对应的32位版本 2.用pip安 ...

  8. MyEclipse 中文注释乱码

    window-->preference-->general-->content type然后在<Content Types>中展开每一个子项,并在<Default ...

  9. iOS杂货

    iOS 导航栏TitleView居中的问题 titleVIew 默认情况下 是居中显示的,出现不居中的情况原因有两个:1,leftBarButtonItem,和rightBarButtonItem 留 ...

  10. USB硬盘 raw之后,DiskGenius 恢复

    最近,为了在E560上安装LINUX(先是gentoo,后是rhel7,最后是 centos7),用UltralISO 把一块移动硬盘给写成RAW格式了.现在又想把移动硬盘给恢复回去.采用一些方法,效 ...