为什么不能减小此文本的行高? [英] Why can't I decrease the line-height of this text?
问题描述
这很奇怪:我有几行文本包裹在 问题的CSS是: 尝试调整高度和高度,改变,你会看到我的意思。 为什么会这样?在CSS中的任何其他位置指定 因为 例如,如果将父对象的line-height设置为10px,那么您也可以将 This is very odd: I have a few lines of text wrapped in an The CSS in question is: Try adjusting the line height both higher and lower and run the updated fiddle after each change, and you'll see what I mean. Why would this be? No Because the For example, if you set the line-height of the parent to 10px, then you would be able to decrease the line-height of 这篇关于为什么不能减小此文本的行高?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!< em>
标签中。不管我做什么,将 line-height
的值降低到17px以下没有任何效果。我可以碰到 line-height c> 上大于17px,它会应用,但我不能得到它低于17px。 / p>
#others .item em {
font-size:13px;
line-height:17px;
}
line-height
,因此没有什么是覆盖它。这可能不是这样的,因为我在同一个选择器中调整 line-height
上下,因此它不会 em
标签是内联的,其行高不能低于其父 div
。
em
标签的行高减小到10px。
<em>
tag. No matter what I do, lowering the value for line-height
below 17px has no effect. I can bump the line-height
up to greater than 17px and it'll apply, but I can't get it lower than 17px.#others .item em {
font-size: 13px;
line-height: 17px;
}
line-height
is specified anywhere else in the CSS, so nothing is overriding it. That couldn't be the case anyway because I'm adjusting the line-height
up and down within the same selector, so it doesn't make sense that a higher value would apply, but a lower value would get overridden.em
tag is inline and its line-height cannot be lower than its parent div
.em
tag to 10px as well.