I work in front end and set CSS background using the shorthand notation very often. I was wondering for a div with a background image whose parent div has a white background – should the child have background-color white or transparent ? Which is better for performance?
ie:
<div id='parent' style='background:white;'>
<div id='child' style='background:WHITE image no-repeat center center;'></div>
</div>
OR
<div id='parent' style='background:white;'>
<div id='child' style='background:TRANSPARENT image no-repeat center center;'></div>
</div>
Simply don’t set the background color in the shorthand declaration. You can skip it.
Saves on bandwidth, and css-browser-rendering-performance is kind of totally Dependant on the users/visitors browser!
Good luck!