CSS Property Value How to - white-space: nowrap;








Question

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

Answer


<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
.text {<!--from  www.  j a  v a  2  s . c  om-->
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 300px
}
</style>
</head>
<body>
  <div class="text">loren ip sum dollar amet loren ip sum dollar
    amet loren ip sum dollar amet loren ip sum dollar amet loren ip sum
    dollar amet loren ip sum dollar amet loren ip sum dollar amet</div>
</body>
</html>

The code above is rendered as follows: