CSS Property Value How to - white-space: nowrap; Reveal a clipped text








Question

We would like to know how to white-space: nowrap; Reveal a clipped text.

Answer


<!--  w ww  . j a  v a2  s . c om-->
<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
div {
  display: block;
  clear: left;
  overflow: hidden;
}

div:hover {
  overflow: visible;
}

#bigBlock {
  width: 100px;
}

.nowrap {
  white-space: nowrap;
}
</style>
</head>
<body>
  <div id="bigBlock">
    <div id="subBlockA" class="nowrap">ABCDEFGHIJKL MNOPQRSTUVWXYZ</div>
    <div id="subBlockB" class="nowrap">12345678901 234567890</div>
  </div>
</body>
</html>

The code above is rendered as follows: