为什么CSS属性'line-height'不能让我在Chrome中缩小行距? [英] Why isn't the CSS property 'line-height' letting me make tight line-spaces in Chrome?

查看:171
本文介绍了为什么CSS属性'line-height'不能让我在Chrome中缩小行距?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个段落标记,该标记在其他地方定义,行高为15px,在页面的下方,我还有一个段落标记,我希望将行高设为10px左右。有趣的是,它不会让我下降到10px或更小,但是当我将其设置为25px或更高时,line-height属性似乎可以正常工作。

I have a paragraph tag that I defined elsewhere with a line height of 15px, and I have another paragraph tag further down the page where I want to make the line height around 10px. Funny thing is, it won't let me get down to 10px or anything smaller than that, but when I set it to 25px or higher, the line-height property seems to be working.

我通过Chrome浏览器的网络开发人员工具(Chrome的Firefox的Firebug版本)检查了相关的CSS(全部为手工编码),但未找到任何相关内容。是否有一个常见的CSS错误会阻止我将行高缩小到一定的最小值以下?

I checked the relevant CSS (all hand-coded) via the Chrome browser's web developer tools (Chrome's version of Firefox's Firebug) and couldn't find anything relevant. Is there a common CSS bug that prevents me from shrinking the line-height beyond a certain minimum amount?

推荐答案

line-height is相对于字体大小,除非声明负边距,否则不能再降低该值。

line-height is relative to font-size, you can't go any lower than that unless you declare negative margin.

这篇关于为什么CSS属性'line-height'不能让我在Chrome中缩小行距?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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