文章来源:

  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. HTML一级导航制作

    今天分享一下简单导航栏的制作方法: 第一步:引入css样式表,新建一个id为nav的层,使用<ul>.<li>.<a>标签来制作完成效果. <!DOCTYPE ...

  2. 持续集成CI与自动化测试

      -------------------------------------------------------------------------------------------------- ...

  3. AsyncTask兼容性

    简介 AsyncTask是Android系统提供的异步方式,其优点在于在子线程执行任务,并将结果传递给主线程. 实现方式 AsyncTask封装了Executor和Handler. 基本使用 通过As ...

  4. Transform.TransformDirection 变换方向

    官方描述: JavaScript ⇒ TransformDirection(direction: Vector3): Vector3; C# ⇒ Vector3 TransformDirection( ...

  5. PostgreSQL Replication之扩展与BDR

    在这一章中,将向您介绍一个全新的技术,成为BDR.双向复制(BDR),在PostgreSQL的世界里,它绝对是一颗冉冉升起的新星.在不久的将来,许多新的东西将会被看到,并且人们可以期待一个蓬勃发展的项 ...

  6. HDU 1269 迷宫城堡(DFS)

    迷宫城堡 Problem Description 为了训练小希的方向感,Gardon建立了一座大城堡,里面有N个房间(N<=10000)和M条通道(M<=100000),每个通道都是单向的 ...

  7. js控制键盘按键(回车、空格)

    <script type="text/javascript">  $(function(){         $(document).keypress(function ...

  8. WindowsServer2012 R2 64位中文标准版(IIS8.5)下手动搭建PHP环境详细图文教程(二)安装IIS8.5

    //来源:http://www.imaoye.com/Technology/WindowsServer2012R264IIS85.html 阿里云服务器ECS Windows Server 2012 ...

  9. vim编辑器设置文件的fileformat

    问题:dos格式文件传输到centos系统时,会在每行的结尾多一个^M,即dos文件中的换行符"\r\n"会被转换为unix文件中的换行符"\n",而此文件若是 ...

  10. XTU 1249 Rolling Variance

    $2016$长城信息杯中国大学生程序设计竞赛中南邀请赛$G$题 前缀和. 把公式化开来,会发现只要求一段区间的和以及一段区间的平方和就可以了. #pragma comment(linker, &quo ...