CSS Properties: How to set the position of a background-image?
Solution:
HTML Code:
Explanation:
- A div element with the ID xyz1 is defined.
- The div has a border, padding, and a background image.
- The background-position property is set to center to position the background image at the center of the div.
Live Demo:
See the solution in the browser
Supported browser
![]() |
![]() |
![]() |
![]() |
![]() |
Yes | Yes | Yes | Yes | No |
What is the difficulty level of this exercise?
Test your Programming skills with w3resource's quiz.