首页
注册
登录
V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请
登录
Can I use?
›
http://caniuse.com/
Less
›
http://lesscss.org
Cool Libraries
›
Bootstrap from Twitter
›
Jetstrap
广告
V2EX
›
CSS
给 div 和 span 元素设置 line-height 为 0,为什么 div 几乎失去了高度,但 span 的高度没有受到影响?
hblevins
·
7 天前
· 329 次点击
https://jsbin.com/hujodilogi/edit?html,output
3 条回复
•
2024-06-27 13:32:16 +08:00
1
QAQqingju
7 天前
块级元素和行内元素
2
tool2dx
7 天前
1
这属于 css 基本知识了。一个是 block 元素,另一个是 inline 元素。
inline 元素设置高度,只能用过设置字体的大小,也就是 font-size ,你设置 line-height 没用。
3
rabbbit
6 天前
1
https://iamvdo.me/en/blog/css-font-metrics-line-height-and-vertical-align
关于
·
帮助文档
·
博客
·
API
·
FAQ
·
实用小工具
·
3828 人在线
最高记录 6679
·
Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 22ms ·
UTC 05:26
·
PVG 13:26
·
LAX 22:26
·
JFK 01:26
Developed with
CodeLauncher
♥ Do have faith in what you're doing.