What is the background-position property in CSS?

The background-position property in CSSCascade Style Sheets is used to set the position of a background image.

The default position of a background image is at the top left corner.

Syntax

background-position: value;

Property value

Here, we can write the value at which we want to place our border-image, like top left, bottom right, center, etc.

Code

Below is the basic HTMLHyperText Markup Language and CSS code to demonstrate the use of the background-position property.

New on Educative
Learn to Code
Learn any Language as a beginner
Develop a human edge in an AI powered world and learn to code with AI from our beginner friendly catalog
🏆 Leaderboard
Daily Coding Challenge
Solve a new coding challenge every day and climb the leaderboard

Free Resources