Set size on background image with CSS?

后端 未结 18 1768
野性不改
野性不改 2020-11-22 12:38

Is it possible to set the size of the background image with CSS?

I want to do something like:

background: url(\'bg.gif\') top repeat-y;
background-si         


        
18条回答
  •  被撕碎了的回忆
    2020-11-22 12:59

    Only CSS 3 supports that,

    background-size: 200px 50px;
    

    But I would edit the image itself, so that the user needs to load less, and it might look better than a shrunken image without antialiasing.

提交回复
热议问题