Can't resize image using CSS

后端 未结 5 1401
萌比男神i
萌比男神i 2021-01-01 03:36

I\'ve tried every answer I could find on all the sites I could find, but still haven\'t been able to properly resize an image using CSS. I\'ve got it inside a div, and tried

5条回答
  •  再見小時候
    2021-01-01 04:01

    The CSS property background:cover will help you!

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

    Cover will extend your background to full screen.

提交回复
热议问题