I understand that background
is the shorthand property - what will the value 0
do to all of the properties and is it valid CSS?
selector {background:0;}
I understand that background
is the shorthand property - what will the value 0
do to all of the properties and is it valid CSS?
selector {background:0;}
background:0
is valid css and gets compiled into:
background-image: initial;
background-position-x: 0px;
background-position-y: 50%;
background-size: initial;
background-repeat-x: initial;
background-repeat-y: initial;
background-attachment: initial;
background-origin: initial;
background-clip: initial;
background-color: initial;
Yes, the zero will be interpreted as the horizontal background position. The other background properties are set to the default values, so you end up with the same as:
background-image: none;
background-repeat: repeat;
background-attachment: scroll;
background-position: 0 center;
background-color: transparent;
© 2022 - 2024 — McMap. All rights reserved.
background: none
notbackground:0
– Jannajannelbackground-image: none
instead ofbackground-position: 0
– Sextuplet