css: line-height 与box-sizing
css
1、line-hight:
行高line-height,是文本行基线这件的距离,不是字体大小,它确定了各个元素框的高度增加或减少多少。
对于块级元素:定义了元素中文本基线之间的最小距离。
line-height并不影响替换元素的布局,但是确实可以应用到替换元素。
行间距:line-height - font-size
定义font属性的时候,用户代理会自动会生成一个line-height。
| 浏览器 | FF | ||||||
| 字体大小(font-size) | 12px | 13px | 14px /15px | 16px | 18px | 20px | 22px |
| 行高(line-height) | 17px | 19px | 20px | 21px | 24px | 27px | 30px |
| 浏览器 | Chrome | ||||||
| 字体大小(font-size) | 12px | 13px | 14px /15px | 16px | 18px | 20px | 22px |
| 行高(line-height) | 17px | 19px | 20px | 21px | 24px | 27px | 30px |
| 浏览器 | IE9 | ||||||
| 字体大小(font-size) | 12px | 13px | 14px | 16px | 18px | 20px | 22px |
| 行高(line-height) | 15.8px | 17.2px | 18.5px | 21.2px | 23.8px | 26.4px | 29px |
| 浏览器 | 360 | ||||||
| 字体大小(font-size) | 12px | 13px | 14px /15px | 16px | 18px | 20px | 22px |
| 行高(line-height) | 17px | 19px | 20px | 21px | 24px | 27px | 30px |
在inline元素中,不是文字撑开了div的高度,而是line-height!
2、box-sizing
只是为了规定box modeling

box-sizing : content-box || border-box || inherit
content-box 为默认值
css: line-height 与box-sizing的更多相关文章
- [css] line boxes
原文链接:http://www.zhangxinxu.com/wordpress/2010/01/css-float%E6%B5%AE%E5%8A%A8%E7%9A%84%E6%B7%B1%E5%85 ...
- css中height 100vh的应用场景,动态高度百分比布局,浏览器视区大小单位
css中height 100vh的应用场景,动态高度百分比布局,浏览器视区大小单位 height:100vh 一些只能vw, vh才能完成的应用场景: 1. 场景之:元素的尺寸限制 vw vh 主要是 ...
- css & auto height & overflow: hidden;
css & auto height & overflow: hidden; {overflow: hidden; height: 100%;} is the panacea! {溢出: ...
- CSS设置height为100%无效的情况
CSS设置height为100%无效的情况 笔者是小白,不是特别懂前端.今天写一个静态的HTML页面,然后想要一个div占据页面的100%,但是尝试了很多办法都没有实现,不知道什么原因. 后来取百度搜 ...
- 构建前端第4篇之---使用css用法 height
张艳涛 写于2021-1-20 height: 100%; What: html的元素标签,例如 <html>,<body>,<div>都有height的css属 ...
- 深入了解css的行高Line Height属性
什么是行间距? 古时候我们使用印刷机来出来文字.印刷出来的每个字,都位于独立的一个块中. 行间距,即传说中控制两行文字垂直距离的东东.在CSS中,line-height被用来控制行与行之间垂直距离. ...
- CSS 盒子模型(Box model)中的 padding 与 margin
本文将讲述 HTML 和 CSS 的关键—盒子模型 (Box model) .理解 Box model 的关键便是 margin 和 padding 属性,而正确理解这两个属性也是学习用 CSS 布局 ...
- 区别CSS中display:box;inline;none以及HTML中 <frame> 标签<table> 标签的 frame 属性
区别display:box:display:inline:display:none三者的不同 display:block的特点是: block是Display默认的值.总是在新行上开始:该对象随后的内 ...
- CSS盒子模型(Box Model)
一.背景 作为CSS的重点,三大模块之一的盒子模型,这部分无论如何也要精通透彻.在任何一个网页当中,都有自己的布局方式,所谓网页布局方式就是如何把网页里面的文字.图片,很好的排版成美工设计的样式,这时 ...
- IE6 CSS高度height:100% 无效解决方法总结
原文地址:http://www.cnblogs.com/huangyong8585/archive/2013/02/05/2893058.html 上面红色部分为 height:100%; 自动拉 ...
随机推荐
- ipaclient 4.5.4 requires jinja2, which is not installed. rtslib-fb 2.1.63 has requirement pyudev>=0.16.1, but you'll have pyudev 0.15 which is incompatible. ipapython 4.5.4 has requirement dnspython>=
- ArcEngine 里面的日期
问题: 将自己做的GIS系统放到其他系统上的时候发现用 IQueryFilter 进行时间查询的时候报错,原来的系统没有这个问题. 原因: 后来调试代码发现查询的时间里面有中文,显示格式 " ...
- how to render html tag
使用autoescaping If autoescaping is turned on in the environment, all output will automatically be esc ...
- DSN
用户DSN注册信息记录在本机的注册表上 文件DSN保存在本地磁盘上 系统DSN注册在服务器的注册表上,所以客户端连接服务器,只要一台在服务器建立了DSN,其他客户端登录时都会看到该DSN
- NPOI导出Excel生成多个sheet
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.We ...
- 为什么说ArrayList是线程不安全的?
一.概述 对于ArrayList,相信大家并不陌生.这个类是我们平时接触得最多的一个列表集合类. 面试时相信面试官首先就会问到关于它的知识.一个经常被问到的问题就是:ArrayList是否是线程安全的 ...
- 元素定位工具Weditor的使用
(1).安装:pip install --pre --upgrade weditor 安装成功 (2).启动python -m weditor
- Java 添加、修改、读取、复制、删除Excel批注
本文介绍通过Java程序来操作Excel批注的方法.操作内容包括批注添加(添加批注文本.背景色.字体.自适应等).修改.读取(文本.图片).复制.删除等. 工具:Free Spire.XLS for ...
- GitHub进阶之利用Git远程仓库篇
#在上一篇文章,相信大家对GitHub已经有了一个基础的理解 接下来我们来学习一下如何利用git来远程仓库 一,git是什么 git:一个免费的开源版本控制软件 用途:利用Git管理GitHub上的代 ...
- Splash简单应用
jd->iphone import requests from lxml import etree # search_key = 'iphone' jd_url = "https:// ...