开发者

ie gradient + background-image

开发者 https://www.devze.com 2023-01-26 06:02 出处:网络
Is there any way to make ie (7,8) display a gradient AND a background-image on the same div? The only way I got it working (but only almost) was by using two filters, one for the gradient and one usi

Is there any way to make ie (7,8) display a gradient AND a background-image on the same div?

The only way I got it working (but only almost) was by using two filters, one for the gradient and one using the AlphaImageLoader - but of course, then you can't position the image.

Declaring a background-image and gradient filter doesn't work, because it simply won't render the image - only the gradient.

Is there any (prefer开发者_JAVA百科ably non-js) solution to this?

If not, I'll have to resort to using a background image for the gradient as well, which isn't quite as nice but won't make much of a difference either...


I would say that adding a little unnecessary markup is the lesser of the evils here. Either that, or let IE-users live without the gradient.

Oftentimes getting your design to work is a trade-off between semantics, performance, standards and pixel perfection. Accepting that fact was hard for me, but it's made me a better front-end developer - I can work faster, and I can make decisions about what metric is important in a given case.

0

精彩评论

暂无评论...
验证码 换一张
取 消