在文本标签上面是什么填充,我如何处理它? [英] What is this padding above the text label and how do I handle it?

查看:106
本文介绍了在文本标签上面是什么填充,我如何处理它?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我为我的网页添加了标签,标签上方有填充,因此它不在我设计的位置。我想删除文本上方的所有空间,以便它与我设置的位置齐平。字体大小越大,从我设置的位置越远。



这里发生了什么事?



以下是其中一个标签的代码:

  label id =Label1551> 12pt< / label> 

#Label2125 {
position:absolute;
left:309px;
top:5px;
width:150px;
height:61px;
color:#000000;
font-weight:normal;
font-family:Arial;
font-size:64px;
}


$ b $ p

我已在标签周围添加了大纲,以便您可以看到结果。



>



UPDATE

这里是更新的代码, http://jsfiddle.net/6gLQU/8/ 。我仍然看到顶部的差距,虽然更小的差距。这是更新的屏幕截图。除了line-height之外是否可能有另一个问题?



>

解决方案

这不是填充,它是 line-height 。我看到你没有在你的css中指定行高,但它将从样式表继承 line-height 。所以尝试给予 line-height font-size 相同的

I added a label to my page and there is padding above the label so it's not in the location I've designed it to be. I want to remove all the space above the text so it is flush to the location I've set it at. The larger the font size the farther from the location I've set it to be.

What the heck is going on here?

Here's the code of one of the labels:

<label id="Label1551">12pt</label>

#Label2125  {
    position:absolute;
    left:309px;
    top:5px;
    width:150px;
    height:61px;
    color:#000000;
    font-weight:normal;
    font-family:Arial;
    font-size:64px;
}

I've added an outline around the labels so you can see the result.

UPDATE:
Here is more updated code here, http://jsfiddle.net/6gLQU/8/. I'm still seeing a gap at the top albeit a smaller gap. Here is the updated screen shot. Is it possible there is another issue besides the line-height?

解决方案

That is not padding, it is line-height. I see that you haven't specified a line-height in your css, but it will inherit line-height from the stylesheet. So try giving a line-height same as that of the font-size

这篇关于在文本标签上面是什么填充,我如何处理它?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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