CSS Property Value How to - background-size: 100%;








Question

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

Answer


<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
body {<!-- w  ww. j a  v  a 2  s.  c om-->
  background: transparent url('http://placehold.it/200x200');
  background-repeat: no-repeat;
  background-size: 100%;
}
</style>
</head>
<body>lol
</body>
</html>

The code above is rendered as follows: