I’m trying to decide the best way to include an image that is required for a script I’ve written.
I discovered this site and it made me think about trying this method to include the image as a data URI (defined by RFC 2397) since it was so small – it’s a 1×1 pixel 50% opacity png file (used for a background) – it ends up at 2,792 bytes as an image versus 3,746 bytes as text in the CSS.
So would this be considered good practice, or would it just clutter up the CSS unnecessarily?
I don’t think you will gain much… and if it is a file image, the browser can cache it. I wouldn’t bother doing it with CSS unless you have a real need for it.