So I am experimenting with using icons in my CSS using base64 encoded pngs. I have used http://www.motobit.com/util/base64-decoder-encoder.asp to convert them. However, the pngs开发者_开发问答 only have an 8bit alpha channel, the pixels are either fully opaque, or fully transparent, no partial transparency. This is leaving my icons with hard edges. Any ideas of a 24bit alpha channel is possible through base64_encode?
The encoder in that page may be buggy. I made a PNG with alpha channels in Photoshop, encoded it using PHP's base64_encode()
, put it in an image, and it works. Take a look at this fiddle for HTML and this fiddle for CSS.
精彩评论