line-height实际上是相当于content区域的高度
结合如下demo解释:因为设置了box-sizing: border-box,所以呢,content区域为:200-10*2 = 180px
不设置box-sizing: border-box,或者设置为box-sizing: content-box,那么这height其实就是content的高度:
代码结果:
wx6375cd1abf2fb 博主文章分类:平凡而伟大的css ©著作权
文章标签 css css3 html line-heigh不居中 谈一谈line-height 文章分类 运维
line-height实际上是相当于content区域的高度
结合如下demo解释:因为设置了box-sizing: border-box,所以呢,content区域为:200-10*2 = 180px
不设置box-sizing: border-box,或者设置为box-sizing: content-box,那么这height其实就是content的高度:
代码结果:
上一篇:js常用的Math方法汇总,js中Math方法汇总,Math方法汇总,常用Math方法汇总
下一篇:Uncaught SyntaxError: Cannot use import statement outside a module
line-height的取值说明
line-height和font-size的计算值之差(在CSS中成为行间距)分为两半,分别增加到字体大小的百分比行距。
谓行高是指文本行基线间的垂直距离。要想理解这句话首先得了解几个基
第一章 Redis 快速入门 Redis是一个Key-Value存储系统。和Memcached类似,它支持存储的value类型相对更多,包括string(字符串)、list(链表)、set(集合)和zset(有序集合)。这些数据类型都支持push/pop、add/remove及取交集并集和差集及更丰富的操
举报文章
请选择举报类型
补充说明
0/200
上传截图
格式支持JPEG/PNG/JPG,图片不超过1.9M