如何用CSS改变小文本的行高?似乎有一个小的线高可以限制

时间:2021-05-07 22:17:45

For example, in this example, how do I get rid of the spacing between the lines of text (on top of the images)?

例如,在这个例子中,我如何摆脱文本行之间的间距(在图像的顶部)?

2 个解决方案

#1


3  

Set your line-height on .box_desc. I also adjusted your top value to compensate:

在.box_desc上设置行高。我还调整了您的最高值以补偿:

.box_desc {
     position: absolute;
     top: 14px;
     line-height: 10px;
 }

You should tweak the line-height/top values to perfection.

您应该将行高/最高值调整为完美。

See: http://jsfiddle.net/XhZMv/

请参阅:http://jsfiddle.net/XhZMv/

#2


0  

Try font-size:0; line-height:0; also fixed width and height.

尝试font-size:0;行高:0;还固定宽度和高度。

#1


3  

Set your line-height on .box_desc. I also adjusted your top value to compensate:

在.box_desc上设置行高。我还调整了您的最高值以补偿:

.box_desc {
     position: absolute;
     top: 14px;
     line-height: 10px;
 }

You should tweak the line-height/top values to perfection.

您应该将行高/最高值调整为完美。

See: http://jsfiddle.net/XhZMv/

请参阅:http://jsfiddle.net/XhZMv/

#2


0  

Try font-size:0; line-height:0; also fixed width and height.

尝试font-size:0;行高:0;还固定宽度和高度。