简体   繁体   English

文字没有对齐中间

[英]Text not aligning middle

在此输入图像描述

As you can see the text is aligned towards the top instead of in the middle. 如您所见,文本朝顶部而不是中间对齐。

It occurs on chrome as well as firefox, various versions including latest. 它出现在chrome和firefox上,各种版本包括最新版本。

Various Line-height / Font-size / Vertical-align doesnt fix anything, it always stays slightly upwards. 各种行高/字体大小/垂直对齐不会修复任何东西,它总是保持略微向上。 I can't find a solution to what this causes? 我无法找到解决这个原因的方法? There is really no fancy css added to it, this is just a blank h1 with padding to it. 真的没有添加花哨的CSS,这只是一个带有填充的空白h1。

I think you either have a padding or margin issue. 我认为你有填充或保证金问题。 Check to see if you are calling and what happens when you taken them off. 检查一下你是否正在打电话以及取下它们后会发生什么。

I found the solution. 我找到了解决方案。 It is my Helvetica. 这是我的Helvetica。 (standard macbook pro font) (标准macbook pro字体)

If I use arial it aligns nicely in the middle, if i use helvetica it is slightly (1px-ish) tilted upwards/downwards. 如果我使用arial它在中间很好地对齐,如果我使用helvetica它稍微(1px-ish)向上/向下倾斜。

see what i mean here: jsfiddle.net/fgUf5 看看我的意思:jsfiddle.net/fgUf5

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM