CSS Property Value How to - background-position: 50% 20%;








Question

We would like to know how to background-position: 50% 20%;.

Answer


<html>
<head>  
<style>
body {<!-- ww w.  j  a v a2  s .com-->
  background-image: url("http://java2s.com/style/download.png");
  background-position: 50% 20%;
  background-repeat: no-repeat;
  background-color: #eaeaea; 
}
  </style>  
</head>

<body>
   <p>This example illustrates the <b>background-position</b> property.</p>
</body>
</html>

The code above is rendered as follows: