Embedding images inside CSS

I had a very needful requirement: to embed an image inside the CSS. I was developing a little application to replace the default “index.php” files in auto listing. But since this script can be reused, I am just sharing/including it from a different location that needs auto listing.

You can see the CSS embedding code that I adapted in auto-listing in the URL: http://auto-listing.googlecode.com/svn/trunk/css/list-css-embed.php

My issue is to make it possible in older IEs, if any. It works well in many other browsers.

The auto-listing is located in Google SVN for public usage.

So again I’m sorry, why are you trying to embed into CSS. I don’t really understand

There is an article here about how to use MIME HTML in the style sheet for data urls in IE<8.

But is better explained here. :slight_smile:

@Innovativecs12
I found that there is a need.
Please see in the attachment. It is an auto listing of certain directory somewhere under htdocs.
Any other path might want to use this script.
Since the URL differers, I cannot re-use the images without having to either embedding the marking images inside css, or changing the URL of the background images in each auto listing.

The second option looks not good to maintain (particularly when several directories under the htdcos may use this auto listing feature - shared).

@Erik J The article looks great. I will try it soon.