简体   繁体   English

png 透明区域在 iPad 上是白色的

[英]png transparent area is white on an iPad

I'm dynamically loading a png logo image with transparent background.我正在动态加载具有透明背景的 png 徽标图像。 So basically the logo is colorful and the background is transparent.所以基本上标志是彩色的,背景是透明的。

But why is the image transparent area white when viewing the webpage on an iPad device?但是为什么在 iPad 设备上查看网页时图像透明区域是白色的?

This question is already answered: Alpha transparent PNGs not displaying correctly in Mobile Safari此问题已得到解答: Alpha 透明 PNGs 在 Mobile Safari 中未正确显示

According to his answer you cant use a 1x1px image, but a 2x2px will work perfectly!根据他的回答,您不能使用 1x1px 的图像,但 2x2px 的图像可以完美运行!

I had the same problem.我有同样的问题。 I solved this, with this css rule:我用这个css规则解决了这个问题:

background-color: rgba( 255, 255, 255, 0.0);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM