I have a problem in IE with PNG8 images in that it appears with a big dirty black border in the shadowing of my *.png. (IE7, IE8)
I am using alphatransparency and basically have shading under my small image. All browsers render this fine, except IE which renders the shading as a black circle?
I need the image "transparent" because it appears on top of a variety of multicolored backgrounds, etc?
Any ideas?
I am compelled to respond. I just solved this issue as well. Just to recap, in IE7 and IE 8, transparent PNG and GIF images in links sometimes have a black border or shadow around them.
You need to check to make sure there is no opacity filters on these images. I have opacity on 100. I changed this to
filter:0;
Remember also for blurry link text, you need to specify a background color for the link or else it will be fuzzy and blurry.
Death to IE!!
I'd like to say thanks for the answer, and to add something.
In my specific instance, I needed to override a style that was:
filter: alpha(opacity=50);
Adding the below code made my opacity correct, but added the issue of the black edges:
filter: alpha(opacity=100);
This is the line that saved me by fixing the issue:
filter: 0;
I hope this helps someone else too!
OK - solved the problem. It seemed that my JS was assigning
filter: alpha(opacity=100);
to the image and this is what was causing the black mark to appear as I had already made the image alphatransparent in the PNG8 encoding.
I have suffered from similar issues with opacity in ie7, ie8 what you can do is give your png image a background color which will remove the ugly borders from the image....It works for me
This worked for me with animated opacities:
img{
background: transparent;
-ms-filter: “progid:DXImageTransform.Microsoft.gradient(startColorstr=#00FFFFFF,endColorstr=#00FFFFFF)”;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#00FFFFFF,endColorstr=#00FFFFFF);
zoom: 1;
}
After searching for alternative solutions, I returned to the source images for answers.
It seems that 24bit .png-files cause problems, but 8bit versions behave well. I haven't researched this in depth.
These settings in Photoshop's Save for Web & Devices -dialog helped me get rid of the black strokes in opacity animations:
PNG-8, Selective, Diffusion, Transparency, Colors: 256, Matte: None, No transparency Dither, Interlaced and Convert to sRGB with "Internet Standard RGB".
You can do it in CSS buy using IE's proprietary filtering system.
filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled='true',sizingMethod='scale',src='pathToYourPNG');
DEMO
you will need to use a blank.gif for the 'first' image in your background declaration. This is simply to confuse ie8 and prevent it from using both the filter and the background you have set, and only use the filter. Other browsers support multiple background images and will understand the background declaration and not understand the filter, hence using the background only.
You may also need to play with the sizingMethod in the filter to get it to work the way you want.
I had the same thing happen to a PNG with transparency that was set as the background-image of an <A> element with opacity applied.
The fix was to set the background-color of the <A> element.
So, the following:
filter: alpha(opacity=40);
-moz-opacity: 0.4;
-khtml-opacity: 0.4;
opacity: 0.4;
background-image: ...;
Turns into:
/* "Overwritten" by the background-image. However this fixes the IE7 and IE8 PNG-transparency-plus-opacity bug. */
background-color: #FFFFFF;
filter: alpha(opacity=40);
-moz-opacity: 0.4;
-khtml-opacity: 0.4;
opacity: 0.4;
background-image: ...;
Related
I am looking to write image filter declarations in IE syntax and was wondering if anyone could recommend one of those css generators that also writes to IE in addition to web-kit and filter?
In any case, the following are the properties that I am looking to replicate in IE:
filter: grayscale(1) contrast(1) brightness(1);
mix-blend-mode: luminosity;
opacity:.5;
filter: invert(42%) sepia(39%) saturate(2795%) hue-rotate(350deg)
brightness(100%) contrast(90%);
Any help translating any of these properties or directing me to literature would be appreciated.
You can use this autoprefixer by ymatuhin for a quick and easy way to prefix your code.
There is also a good article by Prefixr on all of the vendor prefixes and why they are used.
grayscale don't work with IE
You can look this page
I think you can add, just for IE, a div in absolute position covering element with background with opacity.
How can I use the filter brightness - invert in internet explorer.
This works fine on chrome and firefox but not on interet explorer
.imgs {
-webkit-filter: brightness(0) invert(1);
filter : brightness(0) invert(1);
}
Internet explorer does not support css filter.
However, since you're not doing anything fancy with this filters, just making the images white (I'm guessing your're hiding them with js by adding that class?) you can use a different aproach, like using a container around those images with a white background and just set visibility: hidden on the images.
How can I achieve a responsive button that contains a background-image.
It is something like http://codecanyon.net/item/css3-responsive-pagination/full_screen_preview/4266559
However, in my case the "prev" and "next" button is a really long text and in the center is just "title" of the page.
Having a hard time scaling the background-image to make sure it fits into the scaled button and works on IE.
Has anyone ever done this before?
Is it even possible?
Thanks,
Tee
If your target browser support CSS3, simply use background-size
.button
{
background:url(img_flwr.gif);
background-size:contain contain;
background-repeat:no-repeat;
}
Edit:
As you need to support IE8 and below,
you might try:
filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../background.png', sizingMethod='scale');
-ms-filter: "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../background.png', sizingMethod='scale')";
or dl ie-css3.htc and:
behavior: url(ie-css3.htc);
I have this sample: http://jsfiddle.net/funguy/jKfeQ/
Dont be confused, its something here, but slighly visible. I want to apply the opacity only to the .postmorewrapper1, but not to the .read-more1 .
Any advices on how I can reach this? Thanks!
You can't, you'll need to make them siblings and position them to emulate parent/child.
As said by AlienWebguy, you can't do it with a CSS property like Opacity without affecting the children.
If you really need to change the opacity of a parent without affecting it's children, the best cheat would be to swap the background-image of the parent to a png transparent, this way the children won't be affected and the opacity of the parent would seem changed.
The problem is that the opacity property applies to all child elements. An alternative would be to instead use rgba when specifying the background colour to .postmorewrapper1, as opposed to a hex value. So instead of this:
background: #FCFCFC;
opacity: 0.4;
Try this:
background: rgba(252, 252, 252, 0.4)
One thing to bear in mind with this technique though is that IE versions 8 and below don't support rgba (it was added in v9). There are a couple of options to get around this:
Use an IE filter (which can have an impact on performance if overused)
Use a semi-transparent PNG image for IE versions 8 and under (which is less maintainable)
The CSS for option 1 would be:
background: transparent;
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#66FCFCFC,endColorstr=#66FCFCFC)"; /* IE8 */
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#66FCFCFC,endColorstr=#66FCFCFC); /* IE6 & 7 */
zoom: 1;
You'd put that in your IE stylesheet if you have one.
I am making a website that uses nothing but jquery-ui for theming.
Well, in my application I need to do alternating colors per row on a list. Right now all of the rows are just the color of .ui-widget-content. Well, I can apply a class on alternating rows with no problem, but I want for the alternating color to be a very transparent version of the background color in .ui-widget-header. How would I do this using nothing but html jquery and CSS? (I'm really hoping to not have to use javascript in order to do this little trick though)
The easiest way to do this is to create a small flat image in Photoshop, Fireworks,GIMP,Kreta etc. and set the color / opacity there. The above solutions will allow for transparency but they are
1) Not standards-compliant and
2) They May cause the text contained in the div to also be transparent (usually an undesirable result in design).
So...
.ui-widget-content-alt {
background: transparent url(images/my_80%transparent_black_bg.png) top left repeat;
}
.ui-widget-content {
background: transparent url(images/my_80%transparent_white_bg.png) top left repeat;
}
Assuming that I didn't misunderstand your question, and that you can use a separate CSS class for alternate rows like .ui-widget-content-alt, you may want to use the following CSS:
.ui-widget-content, .ui-widget-content-alt {
background-color: #000;
}
.ui-widget-content-alt {
filter: alpha(opacity=20);
opacity: 0.2;
}
The opacity property is the CSS standard for opacity values, and works in Firefox, Safari, Chrome and Opera.
The filter property is for IE.
You may want to check the following article for compatibility of the opacity property with older browsers:
CSS Tricks - CSS Transparency Settings for All Browsers
There is no standard way of doing it.
You can use css opacity and fiter to achieve it.
Something like the following would give you 80% black transparent color
.someClass { background-color:#000; -moz-opacity: 0.8; opacity:.80;filter: alpha(opacity=80);}
Using this will cause your CSS to fail compliance checks.