background-size:50%
The image fills 50% of the element.

background-size:100px 50px
The image is sized to the specified dimensions.

background-size:cover
The image is enlarged to fill the element.

background-size:contain
The image is sized to fit inside the element.

To purchase the stock images in this book and other great stock images, go to bigstockphoto.com

A code example from Stylin’ with CSS, Third Edition by Charles Wyke-Smith. Visit stylinwithcss.com for more CSS information and updates.