使用 CSS 对齐文本最后一行

cssweb developmentfront end technology更新于 2024/3/12 9:16:17

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>

输出


相关文章


有用资源