本文介绍了设定行距的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在CSS中设置行距,就像我们可以在MS Word中设置行距一样?

How can I set line spacing with CSS, like we can set it in MS Word?

推荐答案

尝试行高属性.

例如,字体大小为12px,距底行和底行的距离为4px:

For example, 12px font-size and 4px distant from the bottom and upper lines:

line-height: 20px; /* 4px +12px + 4px */

或以em个单位

line-height: 1.7em; /* 1em = 12px in this case. 20/12 == 1.666666  */

这篇关于设定行距的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-18 17:16