Home  >  Article  >  Web Front-end  >  CSS word wrap property

CSS word wrap property

WBOY
WBOYforward
2023-09-04 11:25:11777browse

The word-wrap attribute is used to break in one line and wrap to the next line.

Example

The example syntax is shown below −

Live demonstration

<!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>

Output

CSS 自动换行属性

The above is the detailed content of CSS word wrap property. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:tutorialspoint.com. If there is any infringement, please contact admin@php.cn delete