为什么垂直对齐受font-weight和Crimson Text字体的影响? [英] Why is vertical alignment afftected by font-weight with Crimson Text font?

查看:291
本文介绍了为什么垂直对齐受font-weight和Crimson Text字体的影响?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近,我一直在使用锚点标签的页面css http://nate.fm/articles/ 如果您为链接 Light Pro-Life vs Pro-Birth 指定边框, code> font-weight 到超过 500 ,然后突然垂直对齐从中间变为顶部。下面我添加了显示此内容的图片:



字体重量700:



A HREF =https://i.stack.imgur.com/dedDm.png相对=nofollow>
$ b

字体重量500

>



更令人惊讶的是,除了 Crimson Text 。我试图复制本地的错误,但失败。



任何人都可以提供一些线索了这个bug?


解决方案

由于你提到它只发生在Crimson Text,它可能只是粗体字体呈现的方式。类似的问题在这里问:粗体文本行 - 高度高于正常文字行高



我玩了一遍,禁用了页面上的所有其他样式,看看是否有东西被覆盖,但找不到任何罪魁祸首。



一个可能的工作可能只是添加一些padding-top。


Recently I have been playing around with the anchor tags' css of the page http://nate.fm/articles/ If you assign border around the link Light or Pro-Life vs Pro-Birth and change their font-weight to more than 500 then suddenly the vertical alignment changes from middle to top. Below I have added images showing this:

Font Weight 700:

Font Weight 500:

More to the surprise, this bug disappears for any other font family than Crimson Text. I tried to replicate the bug on local but failed.

Could anyone shed some light over this bug?

解决方案

Since you mentioned it only happens with Crimson Text, it's probably just the way that font renders when bold. A similar question was asked here: Bold text line-height is higher than normal text line-height

I played around with disabling all the other styles on the page, to see if maybe something was overriding it, but couldn't find any culprits.

A possible work around might just be adding some padding-top.

这篇关于为什么垂直对齐受font-weight和Crimson Text字体的影响?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆