0

I had this:

background-size: cover;
background-position: 50% 50%;
background-repeat: no-repeat;

I folded position and repeat into background, but the end results causes the background-size property to be overriden:

background-size: cover;
background: no-repeat 50% 50%;

Is it possible to folder background-size: cover into the shorthand? I attempted background: no-repeat cover 50% 50% but that's invalid.

Kit Sunde
  • 35,972
  • 25
  • 125
  • 179

1 Answers1

1

I don't think you can include background-size in the shorthand but there should be no issue with including it after the shorthand statement.

EDIT: This answer confirms that you can.

background: no-repeat 50% 50% etc;
background-size: cover;

The shorthand statement overrides all background statements, even ones that haven't been included (or can't be included) in the shorthand statement.

Community
  • 1
  • 1
Paulie_D
  • 107,962
  • 13
  • 142
  • 161