How to Position Backgrounds in CSS

Backgrounds in CSS may be positioned with keywords or percentage values. Let's take a look at how it works.

Positioning Backgrounds with Keywords.

Backgrounds may be positioned with the combination of the keywords: top, left, bottom, right, and center

Example


  background-position: top left
  

The best way to see this at work is to use the playground below:

Create a free account to view this lesson.

By signing up, you agree to Educative's Terms of Service and Privacy Policy