用 CSS 對齊文字的最後一行


text-align-last 屬性用於對齊文字的最後一行。你可以嘗試執行以下程式碼以使用 CSS 對齊文字的最後一行

示例

實況演示

<!DOCTYPE html>
<html>
   <head>
      <style>
         .mydiv {
            text-align-last: right;
         }
      </style>
   </head>
   <body>
      <h1>text-align-last Property</h1>
      <div class = "mydiv">
         <p>This is demo text. This is demo text. This is demo text.
         This is demo text. This is demo text. This is demo text.
         This is demo text. This is demo text.</p>
      </div>
   </body>
</html>

輸出

更新於: 20-6-2020

284 次瀏覽

開啟你的 職業生涯

透過完成課程獲得認證

開始
廣告