• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

14.13. background-spacing

This new property is designed to work in conjunction with the background-image property to set the spacing between individual background images as they are tiled across the background of an element. By default, there is no spacing value between background images, so this property finally gives the Web author some control over this. It can take either one or two numeric values as well as inherit. If a single numerical value is specified, it sets the distance between adjacent background images both vertically and horizontally. If two numeric values are used, the first applies to the horizontal dimension, the second to the vertical. The following code snippet shows how this property could be used (its effects illustrated in Figure 14-18):

<style>
table.example1 {background-image: url(caligula.jpg)}
table.example2 {background-image: url(caligula.jpg); 
background-spacing: 20px}
table.example3 {background-image: url(caligula.jpg); background- 
spacing: 20px 30px}
</style>

Figure 14-18. Mock-up illustrating several spacing values set to the background-spacing property.


  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint