CSS Property Value How to - background-color: lightblue;








Question

We would like to know how to background-color: lightblue;.

Answer


<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
pre, p {<!--from w w  w .  j  av  a  2s  . c  om-->
  background-color: lightblue;
}

.display_whitespace {
  white-space: pre;
}
</style>
</head>
<body>
  <pre>  I am Text
      with
      whitespace displayed</pre>
  <p>I am Text with whitespace ignored</p>
  <p class="display_whitespace">I am Text with whitespace preserved</p>
</body>
</html>

The code above is rendered as follows: