Unfortunately, for different versions and types of browsers around the world, there is no single CSS entry that is compatible in all browsers without JavaScript intervention. However, you can use several modeling methods and access browsers that donβt like modern code using the βif IE 7β HTML code in your head.
Here are a few methods to consider for maximum cross-browser compatibility.
Adding an alternative method for older browsers
If you need transparent backgrounds in later versions of Internet Explorer, this method is simplified for older versions of browsers using old code. You can filter style rules by adding the following code to
<head> </head>
your HTML or PHP file.
HTML WITH HEAD
You should add the following code if you do not already have it. Currently, many frameworks and CMS include, so just review the source before editing and add only if it is not already them.
Make transparent 50 percent PNG file
Just upload any photoshop or any good alternative and create a new 1x1 file, then add a new layer and remove the background. Then inside the layer fill it with the color you want to use, then make this layer opacity 50%. Then save it as PNG and upload it to your hosting. If you are worried about the loading time on the pages, you can use PNGCrush or Smush.it to compress this PNG to less than 0.5 kbytes.
In CSS add this (you need to use IF 7/6, etc.)
.ie6, .ie7, .ie8 .your-div-class-or-id { background: transparent; filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=background.png,sizingMethod='scale'); }
}
CSS for new browsers
You should use the new code for newer browsers whenever possible, and without using PNG to create a transparent background, this means that we do not increase the page load time by adding a file selection. Just add:
background: rgba(32, 80, 129, 0.5)
What will work with modern browsers such as IE9 +, Firefox, Chrome, Safari
You should use both modern and old CSS in combination
Note that you use both CSS elements: RGBA and AlphaImageloader, so the png file is used only when it is absolutely necessary. I know that many of them are unfavorable for using PNG with Opacity, but you use it only in the worst case and not loading it when using a newer browser.