FRIHOST • FORUMS • SEARCH • FAQ • TOS • BLOGS • COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Can l set it so that a background has a certain opacity?





KHO
l would like to put a certain image as the background on a page, however, the colors don't go well with the text. l think that if l could set it so that the backgrounds are a little transparent, then the text would read fine. Any language works, so long as it is supported by frih
Marston
CSS should do the trick, using -moz-opacity, as long as you aren't worried about your CSS's validity (the code works fine on most, if not all modern browsers, but it's depreciated by W3C). Here's the code:
Code:
background-image: url(http://www.yoursite.com/path_to_image/yourimage.jpg);
filter: alpha(opacity=40);
-moz-opacity: .40;
opacity: .40;
You can play with the amounts of opacity and what not, to achieve the desired affect. Click here to learn more about using -moz-opacity.
Hope this helps!
KHO
Marston, the filter: tag only works on IE based browsers Neutral considering my site has a get Fire Fox button on the bottom of it, l don't think it would be very appropriate for it not to work properly in Fire Fox Neutral does anyone else have a soloution??
masterevil
why not make the background image transparent?
Contact me and i'll do it for you if you want to.
KHO
l will if that is the only option left, but it would be nice to be able to do it on the page with the text right there, but l suppose l will just go ahead and photshop them, l will do it myself as there are only like 5 or 6 right now Neutral
Grimboy
KHO wrote:
Marston, the filter: tag only works on IE based browsers Neutral considering my site has a get Fire Fox button on the bottom of it, l don't think it would be very appropriate for it not to work properly in Fire Fox Neutral does anyone else have a soloution??


Marson's method would work under both mozilla, and internet explorer based browsers as it uses two methods. Opacity is probably another method. I think alphavalue is the proposed CSS3 thing.
KHO
Regardless, l pride myself on all languages l have in my site, it is 100% quality programming, and any validator for any lanuage in it will tell you the same Neutral l have it all checked againt the W3 validators, and as is, it works on all browsers, on all machines, for all OS's Neutral and that is something that took a long time to get right Neutral (re-coded the entire site Neutral took like 3 weeks!!!) Neutral
Marston
KHO wrote:
Regardless, l pride myself on all languages l have in my site, it is 100% quality programming, and any validator for any lanuage in it will tell you the same Neutral l have it all checked againt the W3 validators, and as is, it works on all browsers, on all machines, for all OS's Neutral and that is something that took a long time to get right Neutral (re-coded the entire site Neutral took like 3 weeks!!!) Neutral
I can hand-write errorless HTML, and CSS Smile. Force of habit Wink.
KHO
Yes, so can l Neutral.
But switching over to xhtml got me in the habbit of making everything error-less Neutral. So, if l had an error, it would nag at me and just prove that l am a perfectionist as soon as l fix it Neutral.
Related topics
GD-library header probs
Transparant laptops
PHP next step
CSS Help...
Power PC / Intel Mac Users - Code Compiling Required
[*RESOLVED*] Please close for me.
Coming soon: Google Voice Search
Je cherche un logi de vidéo simple et pratique !
Making webpage 'stretch out'?
Site crashes
PHP Image functions
Evolution
Random image script
Can you use animated gifs as desktop backgrounds? :?:
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.