首页  >  文章  >  web前端  >  使用 CSS 设置文本行的高度

使用 CSS 设置文本行的高度

PHPz
PHPz转载
2023-08-25 15:45:061073浏览

使用 CSS 设置文本行的高度

line-height属性用于设置文本行的高度。line-height属性的值可以是数字、长度或百分比。

示例

<html>
   <head>
   </head>
   <body>
      <p style = "width:300px; height:100px; border:2px solid green; padding:5px; margin:10px; line-height:30px;">
         This paragraph is 300 pixels wide and 100 pixels high and here line height is 50 pixels.
      </p>
   </body>
</html>

以上是使用 CSS 设置文本行的高度的详细内容。更多信息请关注PHP中文网其他相关文章!

声明:
本文转载于:tutorialspoint.com。如有侵权,请联系admin@php.cn删除