line-height:1.5和line-height:150%的区别
1. 给你个数,孩子自己算吧 line-height:1.5
父元素设置line-height:1.5会直接继承给子元素,子元素根据自己的font-size再去计算子元素自己的line-height。
2.老子说多大就是多大 line-height:150%
父元素设置line-height:150%是计算好了line-height值,然后把这个计算值给子元素继承,子元素继承拿到的就是最终的值了。
此时子元素设置font-size就对其line-height无影响了。
例1:当line-height:1.5 时:
- body{ font-size:14px; line-height:1.5; }
- h1{ font-size:26px; }
实际结果为:
body的行高为14*1.5=21px
h1的行高为26*1.5=39px
例2:当line-height:150% 时:
- body{ font-size:14px; line-height:150%; }
- h1{ font-size:26px; }
实际结果为:
body的行高为14*150%=21px
h1的行高为直接继承body的行高,为21px
转载地址:
http://www.cnblogs.com/mguo/p/3161277.html
line-height:1.5和line-height:150%的区别的更多相关文章
- 错误:android.view.InflateException: Binary XML file line #167: Binary XML file line #167: Error inflating class <unknown>
1:错误日志 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.8.activity.RecordActiv ...
- bash报错./mq.sh: line 15: warning: here-document at line 10 delimited by end-of-file (wanted `eof')
[root@localhost tmp]# ./mq.sh./mq.sh: line 15: warning: here-document at line 10 delimited by end-of ...
- input01.sh: line 11: warning: here-document at line 4 delimited by end-of-file (wanted `EOF') input01.sh: line 12: syntax error: unexpected end of file
写了个脚本用cat>>EOF报错如下: input01.sh: line 11: warning: here-document at line 4 delimited by end-of- ...
- [转]line-height1.5和line-height:150%的区别
line-height1.5和line-height:150%的区别 一.区别 区别体现在子元素继承时,如下: 父元素设置line-height:1.5会直接继承给子元素,子元素根据自己的font ...
- canvas基础入门(一)canvas的width、height于css样式中的宽高区别
canvas的width.height于css样式中的宽高对画布的内容显示是有所区别的 1.在canvas标签下调用他的width和height,而且是没有单位的宽高,这种指定canvas大小的方法也 ...
- cpan安装报错Invalid host name on line 1 at *FirstTime.pm line 1857.
今天鼓捣一下CPAN,安装时出错: root@ubuntu:~# cpan install DBI CPAN.pm requires configuration, but most of it can ...
- [页面滚动到底部]jquery $(window).height()取值等于$(document).height()的问题
问题现象:JSP中头部引用了某个head.jsp,在videoList.jsp中生成片段时如下 实际最终生成的HTML如下: <!DOCTYPE html>没有解析到,原因找到了,先想办法 ...
- Caused by: android.view.InflateException: Binary XML file line #18: Binary XML file line #18: Error inflating class android.widget.CheckedTextView
困扰了我一天啊 终于吧 这个大bug 给解决掉了 可能是 当时懵逼了 竟然忘记重新构造了!!尴尬了 直接把项目的 build 文件删除重新构造了一边!!
- line-height1.5和line-height:150%的区别
一.区别 区别体现在子元素继承时,如下: 父元素设置line-height:1.5会直接继承给子元素,子元素根据自己的font-size再去计算子元素自己的line-height. 父元素设置line ...
随机推荐
- CMDB服务器管理系统【s5day89】:采集资产之整合资产
1.业务逻辑单独写 1.代码目录结构 2.client.py from src.plugins import PluginManager class BaseClient(object): def p ...
- LINQ To SQL 语法及实例大全【转】
转http://blog.csdn.net/pan_junbiao/article/details/7015633 LINQ to SQL语句(1)之Where Where操作 适用场景:实现过滤,查 ...
- 利用 /proc/sys/kernel/core_pattern隐藏系统后门
ref:https://xz.aliyun.com/t/1098/ 这里所说的core_pattern 指的是:/proc/sys/kernel/core_pattern. 我们知道在Linux系统中 ...
- JavaScript数据类型 String字符串类型的属性和方法
属性 字符串String类型的每个实例都有一个length属性,表示字符串中的字符个数.由于字符串是不可变的,所以字符串的长度也不可变 字符串的length属性不会在for/in循环中枚举,也不能通过 ...
- [再寄小读者之数学篇](2014-06-26 Besov space estimates)
(1) $$\bex \sen{D^k f}_{\dot B^s_{p,q}}\sim \sen{f}_{\dot B^{s+k}_{p,q}}. \eex$$ (2) $$\beex \bea &a ...
- php7 + 新特性 部分
三目运算符: 以前:$type = isset($_GET['type']) ? $_GET['type'] : '测试'; php7.0: $type = $_GET['type'] ?? '测试' ...
- python加密
""#line:4 __all__ =[]#line:6 class OO0O0O000O0O0O000 :#line:8 ""#line:9 def __in ...
- Spring扩展自定义的XML标签
在网上搜了许多,感觉不够全面,就找了官方文档,下面记录如何找到对应的文档进入 网上许多博客都是以dateformat为实例进行编写的,通过官方的foo,能够学到更多的东西,下面贴一段代码,在官方示例上 ...
- Python-HTTP 概况
前端知识 网页最主要由3部分组成: 结构.表现和行为.网页现在新的标准是W3C,目前模式是HTML.CSS和JavaScript. (1)HTML HTML,全称“Hyper Text Markup ...
- centos6.8_manul_install_oracle112040&manu_create_db
--1.1上传oracle软件包及安装环境检查--redhat6.8下载链接:https://pan.baidu.com/s/1eTyw102 密码:cpfs--虚拟机使用独立磁盘时不能拍摄快照--创 ...