What is best practice for using icons?

Should I input in my html for the icons? Or should I be using CSS background?

Also, what if I want to specify both the image (transparent background) with other background colors (don't want to create new .png file each time).

Any help appreciated. Thanks!