Background-size: cover suddenly stopped working in Google Chrome? Background-size: cover suddenly stopped working in Google Chrome? google-chrome google-chrome

Background-size: cover suddenly stopped working in Google Chrome?


Best practice: always set background-image first and then background-size.


You only need to use !important :

background-size: cover !important;


I just ran into this problem in Chrome, too.

None of the above answers worked for me. Specifically, I was trying to set the <body> element background to background-size: cover. However, the background image would never extend vertically to fill the page.

After some trial and error, I found that setting the <html> element width and height to 100% fixed the problem in Chrome. (For what it's worth, changing the <body> element's width and height seemed to have no effect.)

In my css, I have the following rules to fix the issue:

html {  width: 100%;  height: 100%;}