![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I noticed it's apparently impossible to make a PNG (with various levels of opacity) semi-transparent via the usual channels, listed below : filter: progid XImageTransform.Microsoft.Alpha(opacity=75 );opacity: 0.75; -moz-opacity: 0.75; This trio of CSS statements did a pretty good job of covering all the usual bases when it came to making an image partially transparent. However, as mentioned above, it seems to force all of the pixels in the PNG to be exactly *that* transparent (in this case, 75%). So if your PNG is a gradient that goes from 100% opaque to 0% gracefully, applying the above statements to it will cause it to appear to become opaque, as the alpha information is stripped and replaced with "75%" across the board. My question is... is there a way for me to make a PNG image -- one which has various levels of opacity in it (like a gradient going from opaque to transparent) -- semi-transparent while retaining the proportionate individual alpha levels of each pixel? In other words, if I want the PNG to be 75% opaque when shown in a specific situation (like a button that will become 100% opaque on hover/mouseover), while the more opaque pixels of the PNG remain more opaque than the more transparent ones. Is this at all do-able? |
#3
| |||
| |||
|
|
Hi I'd do it using a png containing the two images one with no opacity and another with say 50%. The using CSS set the image to be the backgound and on the hover change the x position of the image ie either move it up or down to show the trnasparent image. Suppose you could also do it with two images using two different backgrounds. HTH |
#4
| |||
| |||
|
|
Good idea, although that would double the number of images. And given then they're all PNGs, I'd rather avoid it if at all possible. Looks like I won't be able to, though. Seems an image swap is the only way around this. "Ian Edwards" <i.edwards (AT) nospamedwards-micros (DOT) co.uk> wrote in message news:g8saq9$3jq$1 (AT) forums (DOT) macromedia.com... Hi I'd do it using a png containing the two images one with no opacity and another with say 50%. The using CSS set the image to be the backgound and on the hover change the x position of the image ie either move it up or down to show the trnasparent image. Suppose you could also do it with two images using two different backgrounds. HTH |
#5
| |||
| |||
|
|
why use png is size is an issue? If you prepared the images in fireworks/xara or photoshop you could always try to export in Gif |
|
ok the colour depth is not a good but is the definition you get on a b utton sufficient to justify the png format? |
#6
| |||
| |||
|
|
Good idea, although that would double the number of images. |
#7
| |||
| |||
|
|
.oO(Mike) Good idea, although that would double the number of images. Not necessarily. You can keep multiple images in the same file and use different CSS background positions to show them. Ian already suggested it, here are actual examples of that technique: http://wellstyled.com/css-nopreload-rollovers.html http://www.alistapart.com/articles/sprites/ Micha |
![]() |
| Thread Tools | |
| Display Modes | |
| |