-
This page lists errata from the book (hopefully not too much!), changes to the specifications since publication, and brand new features.
Categories
Some updates to existing background properties have landed in browsers since the publication of the book.
The background-position property now accepts up to four values to give more flexibility in positioning. Previously all positioning was measured from the top left corner, but with the updated syntax you can change that by using a keyword before each value; for example, to position the background image 20px from the right and 10px from the bottom, you would use this:
e { background-position: right 20px bottom 10px; }
You can also use three values, which must be in the format keyword-keyword-length or keyword-length-keyword:
e { background-position: left top 20px; }
f { background-position: left 20px top; }
This is equivalent to:
e { background-position: left 0 top 20px; }
You can see a few examples of this in Figure 8–12 — as I write this, only Opera, IE9 and Firefox Nightly will display this correctly.
The other change is to the background-repeat property. This now accepts two values, which are equivalent to background-repeat-x and background-repeat-y:
e { background-repeat: repeat no-repeat; }
This is demonstrated in Figure 8–13, but although Firefox 13 should have support for this syntax, these examples use the background-repeat values space and round so as of this writing you’ll need Opera or IE9 to view them.
The browser support tables in Chapter 8 have been updated to show these changes.
— 28 February, 2012