详情见链接

http://www.w3cplus.com/content/css3-background-size/

 

例子:http://www.topcss.org/demo/background-size-cover-contain.html