performance - CSS repeating background, sprite or 1px png -


ok want know best practice performance regarding css background images , http requests.

1. use many different 1px png background images resulting in several individual http requests

or

2. use 1 large image sprite big gradient block chunks use background image. increase file size save on http requests.

love hear opinions...

i think better use data:uri technique small images (like 1px-backgrounds).

background: url(data:image/png;base64,....) top left repeat-x; 

it works modern browsers. old ie browsers (like ie6, ie7) can overwrite styles conditional comments.

background: url("path/to/background.png") top left repeat-x; 

of course way have re-encode background, if has changed. saves lot of requests.


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -