CSS property for IE8 - css

What is the solution for rgba value and border radius value of 0.0 in IE8.
The error i get is
Value "rgba(250, 250, 250, .6)" is not supported. (8.0)
Property "-webkit-border-radius" is not supported. (8.0)

Option 1
http://jquery.malsup.com/corner/
Option 2
http://code.google.com/p/curved-corner/downloads/detail?name=border-radius-demo.zip
Option 3
http://css3pie.com/
Option 4
http://www.netzgesta.de/corner/
Option 5
See this question
EDIT: Option 6
https://code.google.com/p/jquerycurvycorners/ - border-radius.
For rgba you can try create .png image with opacity and sat him as background
or try
.transparent_class {
/* IE 8 */
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";
/* IE 5-7 */
filter: alpha(opacity=50);
/* Netscape */
-moz-opacity: 0.5;
/* Safari 1.x */
-khtml-opacity: 0.5;
/* Good browsers */
opacity: 0.5;
}

Related

CSS: cant use alpha filter [duplicate]

This question already has answers here:
How do I give text or an image a transparent background using CSS?
(29 answers)
Closed 5 years ago.
I am want transparency a screen and show the screen behind
my css:
.correct-answer {
background-color: #98CB66;
filter: alpha(opacity=60);
z-index: 10;
opacity: 0.7;
height: 100%;
width: 100%;
}
i tried use alpha filter in css,
and its not working
if you just want to apply opacity to background-color then you could convert your hex to rgb and use it with alpha
background-color : rgba(152,203,102,0.6);
In another case, if you want to apply opacity to whole block, then use CSS3 filter property.
-webkit-filter: opacity(60%); /* Safari 6.0 - 9.0 */
filter : opacity(60%);
Try Below CSS Snipet :
.yourselector {
background:#000;
opacity: .75; /* standard: ff gt 1.5, opera, safari */
-ms-filter: “alpha(opacity=75)”; /* ie 8 */
filter: alpha(opacity=75); /* ie lt 7 */
-khtml-opacity: .75; /* safari 1.x */
-moz-opacity: .75; /* ff lt 1.5, netscape */
}

css "opacity" property not supporting

<style>
.imgopacity{
opacity:0.2px;
}
</style>
In the above CSS code, the opacity property is not supported, how to obtaining the opacity property if anyhow i want to have one.
Opacity property is not measured in pixels . its a ratio from 0 to 1 to indicate the transparency of an element so your code should be :
<style>
.imgopacity
{
opacity:0.2;
}
</style>
Try:
.imgopacity {
/* IE 8 */
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=20)";
/* IE 5-7 */
filter: alpha(opacity=20);
/* Old Mozilla */
-moz-opacity: 0.2;
/* Safari 1.x */
-khtml-opacity: 0.2;
/* Compliant browsers */
opacity: 0.2;
}
.imgopacity {
opacity:0.2;
}
Simply remove that px from your CSS code. The opacity property does not take value in pixels. It can take a value from 0.0 to 1.0. The lower the value, the more transparent the image will be. For browsers like IE8 and earlier use filter:alpha(opacity=x), where x is a value from 0 to 100.

"-webkit-filter" doesn't work in firefox 41.0.2

I have a css property for a disabled button as follows.
.btn-disabled {
pointer-events: none;
cursor: default;
color:#cecece !Important;
-webkit-filter: opacity(50%)
}
I get the needed effect in chrome, but not in firefox. Is there a way to achieve the same in firefox,chrome,saffari through the same css properties?
You need use prefix for firefox -moz-, this is for all browsers:
.btn-disabled {
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)"; /* IE 8 */
filter: alpha(opacity=50); /* IE 5-7 */
-moz-opacity: 0.5; /* Netscape - firefox */
-khtml-opacity: 0.5; /* Safari 1.x */
opacity: 0.5; /* Good browsers */
pointer-events: none;
cursor: default;
}
You can see that here.
Vendor prefixed properties are experimental features in specific browser engines.
Firefox is built around Gecko, not Webkit, so experimental Webkit features will not work in it.
Avoid using vendor prefixed properties on the open web (unless you are writing sites where the point is to experiment instead of being robust).
Firefox has supported the non-prefixed version for quite some time.
If you really want decent browser support, use the opacity property instead. It has support back to Firefox 1.
simply use firefox -moz- prefix,
.btn-disabled{
pointer-events: none;
cursor: default;
color:#cecece !Important;
-webkit-filter: opacity(50%);
-moz-filter: opacity(50%);
filter: opacity(50%);
}

IE workaround for semi-transparent

What should be the workaround in order to show in pre-IE9 the following CSS:
background-color: hsla(182, 44%,76%,.5);
for transparent element you have more way.
for IE ->
filter: alpha(opacity=40);
filter: progid:DXImageTransform.Microsoft.Alpha(opacity=40);
/* above line works in IE6, IE7, and IE8 */
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(opacity=40)";
/* above line is IE8 only */
and for all browsers:
opacity: .7;
But they are transparent all element , If you need transparent only any color for example background you must use 2 functions rgba or hsla and example for them:
support : (Firefox 3+, Opera 10.1+, Chrome 2+, Safari 3.1+)
#rgba {
background: rgba(98, 135, 167, .4);
}
but IE9 only support it in all version of IE and all browser support css3
#hsla {
background: hsla(207, 38%, 47%, .4);
}
You can use one of Microsoft's proprietary "filters" to do this:
background:transparent;
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#7FA7DBDD,endColorstr=#7FA7DBDD);
zoom: 1;
The hex values are in ARGB order. So convert your color to a RGB Hex value, (#A7DBDD in this case) and put the opacity in front (0.5 is 7F in hex) like this: #7FA7DBDD
This would be best done, of course inside an IE specific stylesheet, perhaps using conditional comments.
Use a separate dom element with solid color and set the opacity ... it will work just fine :)
.bg {
background: #000;
filter: alpha(opacity=50);
opacity: 0.5;
}

CSS background opacity with rgba not working in IE 8

I am using this CSS for background opacity of a <div>:
background: rgba(255, 255, 255, 0.3);
It’s working fine in Firefox, but not in IE 8. How do I make it work?
To simulate RGBA and HSLA background in IE, you can use a gradient filter, with the same start and end color (alpha channel is the first pair in the value of HEX)
background: rgba(255, 255, 255, 0.3); /* browsers */
filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='#4cffffff', endColorstr='#4cffffff'); /* IE */
Create a png which is larger than 1x1 pixel (thanks thirtydot), and which matches the transparency of your background.
EDIT : to fall back for IE6+ support, you can specify bkgd chunk for the png, this is a color which will replace the true alpha transparency if it is not supported. You can fix it with gimp eg.
I believe this is the best because on this page has a tool to help you generate alpha-transparent background:
"Cross browser alpha transparent background CSS (rgba)" (*now linked to archive.org)
#div {
background:rgb(255,0,0);
background: transparent\9;
background:rgba(255,0,0,0.3);
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#4cFF0000,endColorstr=#4cFF0000);
zoom: 1;
}
the transparent png image will not work in IE 6-, alternatives are:
with CSS:
.transparent {
/* works for IE 5+. */
filter:alpha(opacity=30);
/* works for IE 8. */
-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=30)";
/* works for old school versions of the Mozilla browsers like Netscape Navigator. */
-moz-opacity:0.3;
/* This is for old versions of Safari (1.x) with KHTML rendering engine */
-khtml-opacity: 0.3;
/* This is the "most important" one because it's the current standard in CSS. This will work in most versions of Firefox, Safari, and Opera. */
opacity: 0.3;
}
or just do it with jQuery:
// a crossbrowser solution
$(document).ready(function(){
$(".transparent").css('opacity','.3');
});
Though late, I had to use that today and found a very useful php script here that will allow you to dynamically create a png file, much like the way rgba works.
background: url(rgba.php?r=255&g=100&b=0&a=50) repeat;
background: rgba(255,100,0,0.5);
The script can be downloaded here: http://lea.verou.me/wp-content/uploads/2009/02/rgba.zip
I know it may not be the perfect solution for everybody, but it's worth considering in some cases, since it saves a lot of time and works flawlessly. Hope that helps somebody!
There are mostly all browser support RGBa code in CSS but only IE8 and below level does not support RGBa css code. For This here is solution. For The solution you must follow this code and it’s better to go with it’s sequence otherwise you will not get perfect output as you wish. This code is used by me and it’s mostly perfect. make comment if it’s perfect.
.class
{
/* Web browsers that does not support RGBa */
background: rgb(0, 0, 0);
/* IE9/FF/chrome/safari supported */
background: rgba(0, 0, 0, 0.6);
/* IE 8 suppoerted */
/* Here some time problem for Hover than you can use background color/image */
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#88000000, endColorstr=#88000000)";
/* Below IE7 supported */
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#88000000, endColorstr=#88000000);
}
You use css to change the opacity. To cope with IE you'd need something like:
.opaque {
opacity : 0.3;
-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=30)";
filter: alpha(opacity=30);
}
But the only problem with this is that it means anything inside the container will also be 0.3 opacity. Thus you'll have to change your HTML to have another container, not inside the transparent one, that holds your content.
Otherwise the png technique, would work. Except you'd need a fix for IE6, which in itself could cause problems.
I'm late to the party, but for anyone else who finds this - this article is very useful:
http://kilianvalkhof.com/2010/css-xhtml/how-to-use-rgba-in-ie/
It uses the gradient filter to display solid but transparent colour.
To use rgba background in IE there is a fallback.
We have to use filter property. that uses ARGB
background:none;
-ms-filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#33ffffff,endColorstr=#33ffffff);
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#33ffffff,endColorstr=#33ffffff);
zoom: 1;
this is fallback for rgba(255, 255, 255, 0.2)
Change #33ffffff according to yours.
How to calculate ARGB for RGBA
this worked for me to solve the problem in IE8:
-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=1)";
Cheers
This solution really works, try it. Tested in IE8
.dash-overlay{
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#4C000000,endColorstr=#4C000000)";
}
It is very simply you have to give first you have to give backgound as rgb because Internet Explorer 8 will support rgb instead rgba and then u have to give opacity like filter:alpha(opacity=50);
background:rgb(0,0,0);
filter:alpha(opacity=50);
This a transparency solution for most browsers including IE x
.transparent {
/* Required for IE 5, 6, 7 */
/* ...or something to trigger hasLayout, like zoom: 1; */
width: 100%;
/* Theoretically for IE 8 & 9 (more valid) */
/* ...but not required as filter works too */
/* should come BEFORE filter */
-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";
/* This works in IE 8 & 9 too */
/* ... but also 5, 6, 7 */
filter: alpha(opacity=50);
/* Older than Firefox 0.9 */
-moz-opacity:0.5;
/* Safari 1.x (pre WebKit!) */
-khtml-opacity: 0.5;
/* Modern!
/* Firefox 0.9+, Safari 2?, Chrome any?
/* Opera 9+, IE 9+ */
opacity: 0.5;
}
The best solution I found so far is the one proposed by David J Marland in his blog, to support opacity in old browsers (IE 6+):
.alpha30{
background:rgb(255,0,0); /* Fallback for web browsers that don't support RGBa nor filter */
background: transparent\9; /* backslash 9 hack to prevent IE 8 from falling into the fallback */
background:rgba(255,0,0,0.3); /* RGBa declaration for browsers that support it */
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#4cFF0000,endColorstr=#4cFF0000); /* needed for IE 6-8 */
zoom: 1; /* needed for IE 6-8 */
}
/*
* CSS3 selector (not supported by IE 6 to IE 8),
* to avoid IE more recent versions to apply opacity twice
* (once with rgba and once with filter)
*/
.alpha30:nth-child(n) {
filter: none;
}
After searching a lot, I found the following solution which is working in my cases:
.opacity_30{
background:rgb(255,255,255); /* Fallback for web browsers that don't support neither RGBa nor filter */
background: transparent\9; /* Backslash 9 hack to prevent IE 8 from falling into the fallback */
background:rgba(255,255,255,0.3); /* RGBa declaration for modern browsers */
-ms-filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#4CFFFFFF,endColorstr=#4CFFFFFF); /* IE 8 suppoerted; Sometimes Hover issues may occur, then we can use transparent repeating background image :( */
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#4CFFFFFF,endColorstr=#4CFFFFFF); /* needed for IE 6-7 */
zoom: 1; /* Hack needed for IE 6-8 */
}
/* To avoid IE more recent versions to apply opacity twice (once with rgba and once with filter), we need the following CSS3 selector hack (not supported by IE 6-8) */
.opacity_30:nth-child(n) {
filter: none;
}
*Important: To calculate ARGB(for IEs) from RGBA, we can use online tools:
https://kilianvalkhof.com/2010/css-xhtml/how-to-use-rgba-in-ie/
http://web.archive.org/web/20131207234608/http://kilianvalkhof.com/2010/css-xhtml/how-to-use-rgba-in-ie/

Resources