Home
Sign Up
Sign In
V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member
Sign In
• 请不要在回答技术问题时复制粘贴 AI 生成的内容
V2EX
›
程序员
chrome 用 font-weight 上遇到一个怪问题,是怎么回事?
pinews
·
Oct 28, 2019
· 1766 views
This topic created in 2381 days ago, the information mentioned may be changed or developed.
firefox 也有这个问题,就是子元素的高度与撑开的父元素高度不一致
大家可以看演示代码,
https://jsbin.com/cehebobusu/edit?html,output。
用上 font-weight:300 后,a 高度 20,body 元素 22 或 21.5,去掉之后都为 21。
这个是 bug 还是怎滴,我的网站因为这个多了一条白线。
元素
Firefox
撑开
高度
2 replies
•
2019-10-29 04:33:45 +08:00
1
eason1874
Oct 28, 2019
内联元素高度一向很迷,具体机制我不懂,严格要求高宽度对齐的元素我都是用块级,a 标签也来个 display:block,简单粗暴解决战斗。
2
pinews
OP
Oct 29, 2019
@
eason1874
找到原因了 微软雅黑和微软雅黑 light 行高不一样,子元素是 light 的高度,父元素确实正常字体的高度,
About
·
Help
·
Advertise
·
Blog
·
API
·
FAQ
·
Solana
·
5796 Online
Highest 6679
·
Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 60ms ·
UTC 06:44
·
PVG 14:44
·
LAX 23:44
·
JFK 02:44
♥ Do have faith in what you're doing.
❯