CSS3 In-Depth CSS3 In-Depth

Background repeat, attachment and position

Estelle Weyl
Estelle Weyl
HTML5 & CSS3 in the Real World

Repeated backgrounds are controlled with the background-repeat property. This enables vertical/horizontal tiling or allows developers to turn off repeating. Using background-attachment allows images to be fixed to the background of an element or its parent. If you use percentages to position your background images, the browser uses a ratio for positioning. With the introduction of CSS3, some browsers now support background positioning relative to any corner.

Get Unlimited Access Now