CSS word-wrap property


The word-wrap property is used to break the line and wrap onto next line.

Example

The following shows sample syntax −

Live Demo

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

Updated on: 20-Jun-2020

156 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements