CSS word-wrap 屬性


word-wrap 屬性用於斷行並換到下一行。

示例

以下顯示示例語法 −

動態演示

<!DOCTYPE html>
<html>
   <head>
      <style>
         div {
            width: 200px;
            border: 2px solid #000000;
         }
         div.b {
            word-wrap: break-word;
         }
      </style>
   </head>
   <body>
      <h2>word-wrap: break-word property</h2>
      <div class = "b"> ThisisdemotextThisisdemotext:
      thisisaveryveryveryveryveryverylongword. The long word wraps to
      the next line.</div>
   </body>
</html>

輸出

更新於:2020-06-20

190 次瀏覽

啟動您的 職業

完成課程即可獲得認證

開始學習
廣告
© . All rights reserved.