CSS Stretched Background Image

后端 未结 4 866
滥情空心
滥情空心 2021-01-12 09:28

I have a large image to be use as a background-image of a page. What I want is that the height of the image will be stretched to fill the height of the page. It

4条回答
  •  轮回少年
    2021-01-12 10:25

    here is a good writeup

    http://css-tricks.com/perfect-full-page-background-image/

    the gist of it being

    body { 
    background: url(images/bg.jpg) no-repeat center center fixed; 
    -webkit-background-size: cover;
    -moz-background-size: cover;
    -o-background-size: cover;
    background-size: cover;
    }
    

提交回复
热议问题