CCSS Background Spacing

« Previous Tutorial Next Tutorial »

The background-spacing Property

The background-spacing property is used to specify the distance between the images that are repeated in the background of an element.

It takes the value to specify the horizontal and vertical space, related to the coordinates specified by the background-position property.

The following code fragment shows the use of the background-spacing property:

<body style="background-image: url('picture.gif');
   background-repeat: repeat-x;
   background-spacing: 20px 50px;" >

It should be noted that if you specify a single value, this value gives the horizontal and vertical spacing both. However, if you give two values, the first value gives the horizontal spacing and the second gives the vertical spacing.

CSS Online Test

« Previous Tutorial Next Tutorial »

© Copyright 2021. All Rights Reserved.