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

Chapter 14. Background Properties > background-quantity

14.12. background-quantity

The background-quantity property is designed to be used in conjunction with the background-image property to set how many times the background image repeats. It can take one of three values: infinite, a specific numeric value and inherit. The infinite value is the default value, which tiles the background image over the entire area selected. The numeric value tells the browser how many times the image should tile, which can lead to some interesting looking effects. Interestingly enough, there is an inherit value, which is particularly useful in this case, as it is easy to think of a case where you'd want to ensure that the background image tiles the same number of time across different Web elements. The following code snippet shows how this property could be used (its effects illustrated in Figure 14-17):

<style>
table.example1 {background-image: URL(caligula.jpg); 
background-quantity: infinite}
table.example2 {background-image: URL(caligula.jpg); 
background-quantity: 3}
table.example3 {background-image: URL(caligula.jpg); 
background-quantity: 5}
</style>

Figure 14-17. Mock-up illustrating several values attached to the background-quantity property.


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