CSS Property Value How to - white-space: pre-wrap;








Question

We would like to know how to white-space: pre-wrap;.

Answer


<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
pre {<!--from w w w  .ja  v a  2 s  . com-->
  white-space: pre-wrap;
  white-space: -moz-pre-wrap; /* Mozilla */
  word-wrap: break-word; /* Internet Explorer */
}
</style>
</head>
<body>
  <pre>
 >> this is a test
>> this is a test
>> this is a test
>> this is a test.
</pre>
</body>
</html>

The code above is rendered as follows: