首頁  >  文章  >  web前端  >  使用 CSS 設定文字行的高度

使用 CSS 設定文字行的高度

PHPz
PHPz轉載
2023-08-25 15:45:061075瀏覽

使用 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刪除