Does this reduction for background remove other attributes?

If I have:

background:#A2A2A2 url('./images/img.png') repeat-x left bottom; 

and then I use:

 background:#000000; /* not to confuse with 'background-color' */ 

Are the background-image , background-repeat and background-position tags background-position ?

+1
source share
1 answer

background-image , background-repeat and background-position (among other things) will be implicitly set to default values ​​when you leave them in the shortened property. This is how shorthand property works (for the most part).

The calculated background styles look something like this:

 background-color: #000000; /* Your specified value */ background-image: none; /* Default value */ background-repeat: repeat; /* Default value */ background-position: 0% 0%; /* Default value */ 

So, yes, the values ​​you specified in the first abbreviated ad will be lost.

+6
source

All Articles