Sylwek Sylwek - 6 months ago 82
Less Question

background: transparent; vs background: 0 0; differences and threats

I've noticed that

background: transparent
is changed into
background: 0 0;
using
less
. I'm using
grunt-contrib-less
in
1.4.1
version that uses
"less": "~2.7.1"
to transform less to css. What these
0 0
in background are responsible for? Are there any treats resulting from using
background: 0 0
instead of
background: transparent
? I tried to google this but i couldn't find anything that will explain me that

Answer Source

Practically you will not get any treats by using the property background: 0 0; rather background: transparent
what exactly this background: 0 0 is short hand notation of

background-image: initial;
background-position-x: 0;
background-position-y: 0;
background-size: initial;
background-repeat-x: initial;
background-repeat-y: initial;
background-attachment: initial;
background-origin: initial;
background-clip: initial;
background-color: initial;

Where every background property is set to initial and background position is set to 0 0 and answer for your another question why Less is changing background:transparent to background: 0 0 is IE7 or below doesnt support transparent property so Less is changing it into another shorthand notation which gives the same output

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download