CSS 属性:

background-size:

  • 100px 100px
  • 75px 75px
  • 10px 150px
  • 200px
  • 50%
  • 100% 100%
  • cover
  • contain

结果:

CSS 代码:

div#DemoArea
{
background-image:url('/i/eg_smile.gif');
background-repeat:no-repeat;
background-size:100px 100px;
}