CSS word wrap property

WBOY
Release: 2023-09-04 11:25:11
forward
779 people have browsed it

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>
Copy after login

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!

source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template