Base 64 CSS background image not showing in IE
Does anyone know how to make a base 64 encoded CSS image show in IE?
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA...
Currently the image does not appear in IE.
Update
I used
img{behavior:expression((this.runtimeStyle.behavior="none")&&(/^data:开发者_如何学C.*;base64/i.test(this.src))&&(this.src="/my/base64.php?"+this.src.slice(5)));}
per dean in my css and turned my css background image into an img tag, as dean's solution only supports img tags.
It failed with a PNG-24
, but was successful with a PNG-8
I am converting graphics with this tool for mac.
There are some methods described here for mimicking the same kind of behaviour in IE.
If you're interested in using Javascript to get IE to conform, there's some useful information here on Dean Edwards site.
Internet Explorer does not support base64 encoded images. There are plenty of workarounds, though.
Yup, dude this will not work in versions IE less than 8:
http://en.wikipedia.org/wiki/Data_URI_scheme#Web_browser_support
精彩评论