line-height:150% 和 line-height:1.5
line-height属性的细节
与大多数CSS属性不同,line-height支持属性值设置为无单位的数字。有无单位在子元素继承属性时有微妙的不同。
有单位(包括百分比)与无单位之间的区别
有单位时,子元素继承了父元素计算得出的行距;无单位时继承了系数,子元素会分别计算各自行距(推荐使用)。
1 当line-height:xxx %时:
body{ font-size:14px; line-height:150%; }
h1{ font-size:26px; }
实际结果就是:
body{ line-height:21px; /* 14px*150%=21px */ }
h1{ line-height:21px; } /* 继承父元素计算出来的line-height ,21px */
2 当line-height:x.x 时:
body{ font-size:14px; line-height:1.5; }
h1{ font-size:26px; }
实际结果就是:
body{ line-height:21px; /* 14px*1.5=21px */ }
h1{ line-height:39px; /* 26px*1.5=39px */ }
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 ...
- 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} ...
- 利用canvas图片剪切
<!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml"><head> <met ...
- js改变盒子大小(上下左右)分析
js改变盒子大小 知识点 三个mouse事件:mousedown mousemove mouseup css的定位和cursor 思路 先解决单边问题识别范围,得到所选区域 event. 根据距离,判 ...
- Vuejs——(4)v-if、v-for
版权声明:出处http://blog.csdn.net/qq20004604 目录(?)[+] (二十)v-if ①标准v-if用法 简单来说,该值为true则显示该标签,为false则不显示 ...
随机推荐
- c# 爬虫(一) HELLO WORLD
最近在摸索爬虫相关的东西,写点随笔,以便忘记. 目的与用途 现实的项目中,我们需要太多的第三方接口了.而往往这些第三方接口由于条件限制,一时拿不到. 譬如: 1. 淘宝网今天有什么特价商品. 2. 百 ...
- git Permissions 0777 for '/home/xxx/.ssh/id_rsa' are too open.
使用 git 时出现下面的问题,原因是 git 公钥的权限被修改了. @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ WAR ...
- maven下载源代码,中文注释乱码的处理方法
通过maven下载的源码,如果有注释是中文的话,一般会有乱码问题,解决办法如下: Window -> Preferences -> Content Types -> Text -&g ...
- java工具类-邮件发送
mail-1.4.jar package com.huawei.it.citools.mail; import java.util.Date;import java.util.List;import ...
- SimpleDateFormat 和 LocalDate、LocalTime 以及时间大小比较简单示例
package mytest; import java.text.ParseException; import java.text.SimpleDateFormat; import java.time ...
- Oracle表空间知识
Oracle表空间知识 一,创建临时表空间 CREATE temporary TABLESPACE TEMP_PNLREPORT tempfile '/oradata2/ORCL/temp_pnlre ...
- Curl Methods
curl -H "Content-Type:application/json" -H "Authorization token:d0a92f4c29b448c010b59 ...
- ES6系列_7之箭头函数和扩展
1.默认值 在ES6中给我们增加了默认值的操作相关代码如下: function add(a,b=1){ return a+b; } console.log(add(1)); 可以看到现在只需要传递一个 ...
- CImage 往Picture Control贴图 图像显示不正常
在使用CImage 往vc控件 picture Control 上贴图的时候图像显示不太正常如图: 已知原始图片的宽高为640*640 而我上面picture Control 控件宽高小于原始图像 ...
- Win7+Ubuntu12.04(EasyBCD硬盘安装)
安装双系统 Windows7 + Ubuntu12.04 软件准备 准备两个东西EasyBCD软件和iso镜像(我用的easybcd是2.2版,就下载1.7之后版就行,要那种安装版的,不要绿色版) E ...