In case the background-image property could only have a single value.
background-image: url("imagem/img1.jpg");
And if in case you wanted to put background-repeat: no-repeat
for the image not to repeat? easy add property.
background-image: url("imagem/img1.jpg");
background-repeat: no-repeat;
And for the image to stay fixed and change the position? obviously add the properties.
background-image: url("imagem/img1.jpg");
background-repeat: no-repeat;
background-attachment: fixed;
background-position: 50% 50%;
What if my image has a transparent background and I wanted to add a background color? it’s the last time! add the property.
background-color: rgb(140, 50, 190);
background-image: url("imagem/img1.jpg");
background-repeat: no-repeat;
background-attachment: fixed;
background-position: 50% 50%;
You, uh, notice anything about the last bit of code? here if you wanted to change the color, image, not repeat, fix and position you would have to set 5 properties and this leaves your code CSS
very large and for that has the property background
, which is a shorthand property or is an abbreviated property with it you define the 5 properties as I quoted in the code above in only one property.
background: rgb(140, 50, 190) url("imagem/img1.jpg") no-repeat fixed 50% 50%;
It seems kind of complicated but no, just follow this order regardless if one of the values is missing.
background-color
background-image
background-repeat
background-attachment
background-position
Along you go deeper into the CSS
you will see that there are other properties of shorthand (abbreviated) and I bet you have already made use of some.
margin
padding
border
border-radius
animation
transition
background
is a more comprehensive property, the other is specific...– MagicHat