Search code examples
htmlcsssafari

Background color CSS not working in safari but working fine in Chrome, Firefox


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 }
}

I have tried all versions of background color(bgcolor, background-color etc) & also tried the hack

#safari{
    background-color:#FFF
} 

but none worked. please help. Also the Link tags not working in IE only but working perfectly in other browsers.


Solution

  • 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
    }