CSS Property Value How to - word-wrap: break-word;








Question

We would like to know how to word-wrap: break-word;.

Answer


<!--   w w w. ja  v a  2 s  .c  o  m-->

<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
.large {
  font-size: 72px;
  word-wrap: break-word;
}
</style>
</head>
<body>
  <span class="large">asdasdasasdasdasd</span>
  <div class="large">asdasdasasdasdasd</div>
  <div>Hello World Hello World Hello World Hello World Hello World
    Hello World Hello World</div>
</body>
</html>

The code above is rendered as follows: