CSS Property Value How to - background-position: left center;








Question

We would like to know how to background-position: left center;.

Answer


<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
#container {<!--   w w  w .  j a va2  s . c o  m-->
  width: 300px;
  height: 100px;
  border: 1px solid #ccc;
  background-image: url("http://placehold.it/200x200");
  background-position: left center;
  background-repeat: repeat-x;
}
</style>
</head>
<body>
  <div id="container">
    <img src="http://placehold.it/20x20" />
  </div>
</body>
</html>

The code above is rendered as follows: