...

View Full Version : css opacity



sir pannels
04-26-2006, 11:02 AM
hi

ok bit of a problem with css..

using the following..


<span style=\"float:left;filter:alpha(opacity=25);-moz-opacity:.25;opacity:.25;\">

this is to make an image transparent, it works... only problem is it move sthe image to the left.. i have changed float to 'center' and then it goes to centre but is not transparent.. tried putting in extra div align and just align and it made no difference.

anyone have any idea how to make a image transparent but also have it centered?

thanks =]
P

Masterslave
04-26-2006, 11:27 AM
Perhaps making the span a div and then give it:


margin: 0 auto;

And the set a width for the container for that div withthe opacity.

I think...

sir pannels
04-26-2006, 11:30 AM
thanks for the reply...

however just tried it... does the same, no such luck :(

Bill Posters
04-26-2006, 11:58 AM
If it's to make an img semi-opaque, why aren't you applying the styling to the img element itself?
(incidentally, it's far tidier to apply styles via a class than to load element tags up with inline styles.)

VIPStephan
04-26-2006, 12:54 PM
Maybe if you provided the entire code we could give you some better advice?
The only advice I can give you right now is: There is no float: center;, only left, right, or none.

oldcrazylegs
04-27-2006, 01:50 AM
you cannot set float to center. only left or right will work.

center objects in ie
text-align:center;

center objects in all other browsers
margin:0 auto;

use both

Masterslave
04-27-2006, 08:55 AM
IE can understand margin: 0 auto;!
Only IE >6 doesn't understand that and the we have to use text-align: center; indeed.

EDIT: Hehe your right Bill Poster. :D Wrong sign...

Bill Posters
04-27-2006, 09:01 AM
IE can understand margin: 0 auto;!
Only IE >6 doesn't understand that and the we have to use text-align: center; indeed.

Surely you mean IE<6 (versions of IE earlier/less than version 6)

sir pannels
04-28-2006, 09:50 AM
ah thank you all, i have now put it within the actual img tag with float set to none and it is working great.

Shame it dont work in opera but ohwell.

Thanks for all your help, great thread.

Sir P



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum