在 HTML5 中建立一個正文,使正文文字從右向左顯示


在 HTML 中可以使用 dir 屬性為一個段落設定從右到左的文字方向。為 dir 屬性新增文字值 rtl,這樣這個文字從右至左排列。

示例

你可以嘗試執行以下程式碼來實現 dir 屬性 −

<!DOCTYPE html>
<html>
   <body>
      <p dir="rtl">This is demo paragraph. This is demo paragraph.
         This is demo paragraph. This is demo paragraph. This is demo paragraph.
         This is demo paragraph. This is demo paragraph.</p>
   </body>
</html>

更新時間: 03-03-2020

301 次瀏覽

開啟你的 職業生涯

完成課程,獲得認證

開始
廣告
© . All rights reserved.