line-height:150% 和 line-height:1.5的区别
line-height:150%
是继承父元素的距离
line-height:1.5
是计算各子元素的距离
1、当line - height 为百分比时:
body{
font-size:14px; line-height:150%;
}
p{
font-size:21px;
}
结果就是:
body{
line-height:21px;//14*150%=21
}
p{
line-height:21px;//继承父元素
}
2、当line-height 为 X.X时:
body{
font-size:14px;
line-height:1.5;
}
.p1{
font-size:26px;
}
.p2{
font-size:21px;
}
结果就是:
body{
line-height:39px;//26*1.5 = 39
}
.p1{
line-height:39px;//26*1.5=39
}
.p2{
line-height:31px;//21*1.5 = 31.5(约等于31)
}
line-height:150% 和 line-height:1.5的区别的更多相关文章
- jquery的height()和javascript的height总结,js获取屏幕高度
jquery的height()和javascript的height总结,js获取屏幕高度 2014年9月18日 15048次浏览 引子 今天是九一八事变八十三周年,大家勿忘国耻!加油学习!经济和技术等 ...
- obj.offsetHeight与obj.style.height $(obj).height()与$(obj).css('height')
相同:都可以获取obj的高度区别:(1)obj.offsetHeight可以获取外部.内嵌和内联中定义的高,而obj.style.height只能获取内联中定义的高:(2)obj.offsetHeig ...
- canvas基础入门(一)canvas的width、height于css样式中的宽高区别
canvas的width.height于css样式中的宽高对画布的内容显示是有所区别的 1.在canvas标签下调用他的width和height,而且是没有单位的宽高,这种指定canvas大小的方法也 ...
- Bug整理——$(window).height()获取到$(document).height()的问题
想看解决方案不想看无聊乏味的bug解决过程的同学,请直接跳转到页面底部~ 今天在做项目的过程中遇到了一个BUG,项目中需要获取到浏览器客户区的高度以方便做一些适应性调整,代码如下: $(documen ...
- error: OpenCV Error: Assertion failed (0 <= roi.x && 0 <= roi.width && roi.x + roi.width <= m.cols && 0 <= roi.y && 0 <= roi.height && roi.y + roi.height <= m.rows) in cv::Mat::Mat
问题原因: You are probably working outside of the image dimensions. Does any of the values you pass to t ...
- How to Get Vertical Line from Point and Line
Description How to get vertical line cross one point which out of line in line. QPoint Line::Vertica ...
- Go to the first line OR the last line of the file
(1) 跳到首行 :1 或 gg (2)跳到最后一行 :$ 或 G 或shift+g(大写.当前若大小写锁定直接按g,未锁定则按shift+g)
- [gym102412D]The Jump from Height of Self-importance to Height of IQ Level
考虑使用平衡树维护该序列,操作显然可以用fhq treap的分裂+合并来实现 进一步的,问题即变为维护哪些信息来支持push up的操作(并判定是否存在$a_{i}<a_{j}<a_{k} ...
- CSS3学习笔记--line-height:150%与line-height:1.5的真正区别
代码: <div style="line-height:150%;font-size:16px;"> 父元素内容 <div style="font-si ...
- 利用canvas图片剪切
<!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml"><head> <met ...
随机推荐
- 由浅入深之Tensorflow(1)----linear_regression实现
Tensorflow是目前非常流行的deeplearning框架,学习Tensorflow最好的方法是github上的tf项目https://github.com/tensorflow/tensorf ...
- maven 介绍(二)
本文内容主要摘自:http://www.konghao.org/index 内部视频 三.仓库 仓库:本地仓库:远程仓库:私有仓库(nexus) 1. nexus 的安装: 1). 下载并且解压缩 2 ...
- js 空数组 空对象判断
js 空数组是true还是false 1 2 var arr = new Array(); // 或 var arr = []; 我们知道,初始化后,即使数组arr中没有元素,也是一个object ...
- netty8---自定义编码解码器
package com.cn.codc; import org.jboss.netty.buffer.ChannelBuffer; import org.jboss.netty.channel.Cha ...
- C++文件路径的写法
转自:http://blog.csdn.net/chengonghao/article/details/51057780 文件路径的表示可以分为绝对路径和相对路径: c++中\\是一种转义字符,他表示 ...
- TCP/UDP 端口
端口说明 小于1024的端口通常运行一些网络服务 大于1024的端口用来与远程机器建立连接 TCP端口 = 回显 = 丢弃 = 在线用户 = 时间服务 = 网络状态 = 每日引用 = 消息发送 = 字 ...
- GATK的硬过滤
https://software.broadinstitute.org/gatk/documentation/article.php?id=2806
- 20145313张雪纯 《Java程序设计》第4周学习总结
20145313张雪纯 <Java程序设计>第4周学习总结 教材学习内容总结 6.1何谓继承 程序代码重复时,可以把相同的程序代码提升为父类.继承除了可避免类之间重复的行为定义以外,还有i ...
- 20145327实验二Java面向对象程序设计
Java面向对象程序设计 实验内容 初步掌握单元测试和TDD 理解并掌握面向对象三要素:封装.继承.多态 初步掌握UML建模 熟悉S.O.L.I.D原则 了解设计模式 伪代码,产品代码,测试代码的应用 ...
- android与linux之间的关系
篇一(system/core/init/init.c): 对Android感兴趣的朋友都知道,Android系统是建立在Linux内核之上的.那么Linux内核和Android什么关系?Linux内核 ...