CSS Property Value How to - background-size: cover;








Question

We would like to know how to background-size: cover;.

Answer


<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
body {<!--  w w w  .j a  va2  s.co m-->
  background: #000 url('http://www.java2s.com/style/download.png') no-repeat center
    center fixed;
  -webkit-background-size: cover;
  -moz-background-size: cover;
  -o-background-size: cover;
  background-size: cover;
}
</style>
</head>
<body>
</body>
</html>

The code above is rendered as follows: