背景颜色CSS在Safari浏览器中不起作用,但在Chrome,Firefox中正常工作 [英] Background color CSS not working in safari but working fine in Chrome, Firefox
问题描述
我制作了一个网站,其中我将白色背景颜色(#FFF)应用于我的面板(div)以添加一些透明效果。这在铬&火狐。但在Safari中不起作用。我应该怎么做才能在safari中创建相同的效果。
I have made a website in which i am applying white background color(#FFF ) to my panels(a div) to add some transparency effect. This works very fine in chrome & firefox . But doesn't work in Safari. What should i do to create the same effect in safari.
.panel{
position:relative;
background-color: #FFF;
background:#FFF;
bgcolor:#FFF;
#safari { background-color:#FFF }
}
我有尝试所有版本的背景颜色(bgcolor,背景色等)&也尝试过黑客
I have tried all versions of background color(bgcolor, background-color etc) & also tried the hack
#safari{
background-color:#FFF
}
但没有工作。请帮忙。
此外,链接标签在IE中不起作用,但在其他浏览器中完美工作。
but none worked. please help. Also the Link tags not working in IE only but working perfectly in other browsers.
推荐答案
你有白色背景不会增加任何透明度。
A white background does not add any transparency.
你可以尝试以下操作,该操作适用于所有浏览器:
You can try the following, which should work in all browsers:
.my-class {
background-color: rgb(255,255,255); // White background for old browsers
background-color: rgba(255,255,255,0.5); // White background, 50% transparency for more modern browsers. Will be ignored by old browsers
}
这篇关于背景颜色CSS在Safari浏览器中不起作用,但在Chrome,Firefox中正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!