Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 406
Sylwek Avatar asked Dec 05 '25 14:12

Sylwek


1 Answers

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

like image 129
Aravind Reddy Avatar answered Dec 09 '25 13:12

Aravind Reddy