如何在 CSS 中設定文字之間間距?


若要設定文字之間的空白,請使用 white-space 屬性。可能的值為 normal、pre、nowrap。

示例

你可以嘗試執行以下程式碼,在 CSS 中設定文字之間的空白

<html>
   <head>
   </head>
   <body>
      <p style = "white-space:pre;">
         This text has a line break and the white-space pre setting tells the browser to honor
         it just like the HTML pre tag.</p>
   </body>
</html>

更新於: 31-01-2020

162 次瀏覽

啟動你的職業

完成課程並獲得認證

立即開始
廣告
© . All rights reserved.