Set the Background Image Position with CSS


To set the background image position, use the background-position property. You can try to run the following code to learn how to work with the background-position property:

Example

It sets the background image position 80 pixels away from the left side:

<html>
   <head>
      <style>
         body {
            background-image: url("/css/images/css.jpg");
            background-position:80px;
         }
      </style>
   </head>
   <body>
      <p>Tutorials point</>
   </body>
</html>

Updated on: 30-Jan-2020

406 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements