HTML 5透明背景图像不起作用 [英] HTML 5 Transparent Back Ground Image not working

查看:231
本文介绍了HTML 5透明背景图像不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我在Paint.net上制作了一个带有透明背景的图像并将其保存为png文件。但由于某种原因,当我在我的网站上添加该图像时,透明背景变为灰色。我不确定是否需要在我的HTML行上添加一些变量或者图像不正确。

Hi,

I made a Image with a transparent background on Paint.net and saved it as a png file. But for some reason when i add that image on my website the transparent background turns grey. I am not sure if a need to add some variable on my HTML line or if the image is not correct.

推荐答案

你好budy,



好​​吧,如果你已经完成了图像核心,我的意思是你正确保存它,那么问题不在图像本身。现在尝试在没有CSS的空白Html页面中加载图像,以查看问题是否在样式中!如果透明的工作然后尝试修复您的网站中的CSS。尝试找到规则并修复它!



如果您对此有更多疑问,请随时提出! :)



O ...别忘了使用RGB颜色!现在...如果你想将图像中div的样式转换为...



Hello budy,

Well if you have done the image corectly, i mean you save it correctly, then the problem isn't in the image itself. Now try to load the image in a blank Html page without css to see if the problem is in the style! If the transparent work then try to fix the css in your website. Try to find the rule and fix it!

If you have more questions about this, feel free to ask! :)

O...don't forget to use always RGB colors! Now...if you want turn the style of the div in the image to ...

background: rgb(0, 0, 0);
/* RGBa with 0.5 opacity */
background: rgba(0, 0, 0, 0.5);





否则只需使用设置了不透明度的图像。这将涵盖所有浏览器。



Otherwise just use an image with the opacity set on there. That would cover all browsers.


这篇关于HTML 5透明背景图像不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆