atholon Posted April 17, 2009 Share Posted April 17, 2009 Hi, I am trying to make a div have a semi transparent background using the filter and moz property on that div. The problem is is that it is making all the text and images placed inside of that div also transparent. Is there a way to fix that and just make the background itsself transparent? Quote Link to comment https://forums.phpfreaks.com/topic/154550-div-transparency/ Share on other sites More sharing options...
jackpf Posted April 17, 2009 Share Posted April 17, 2009 I don't think so. I think the general idea of opacity is that everything is that opacity. You could do something like...have a div with a background and an opacity, then a div with the text in on top of the other div, with an absolute position and z-index: 1. Something like that anyway. Quote Link to comment https://forums.phpfreaks.com/topic/154550-div-transparency/#findComment-812676 Share on other sites More sharing options...
atholon Posted April 17, 2009 Author Share Posted April 17, 2009 Well I figured I could do that with a PNG image as the background. it wouldn't matter that much but there's a water mark type thing that is on the very bottom Quote Link to comment https://forums.phpfreaks.com/topic/154550-div-transparency/#findComment-812708 Share on other sites More sharing options...
Axeia Posted April 18, 2009 Share Posted April 18, 2009 How about, #semiTransparent * { -moz-opacity: 1; } Granted all text is wrapped in a container like <p>. Quote Link to comment https://forums.phpfreaks.com/topic/154550-div-transparency/#findComment-813094 Share on other sites More sharing options...
bronzemonkey Posted April 18, 2009 Share Posted April 18, 2009 Using {opacity:1;} (because opacity is now fully supported by mozilla) won't work because it will only be 100% opacity that is inherited from the parent. If by semi transparent background you mean only semi transparent background colour, then you can use: {background:#000; background:rgba(0,0,0,0.5);} rgba is supported by all mozilla and webkit browsers. Declare a background colour before the rgba declaration to act as a fallback for any browsers that don't support rgba. In the rgba declaration the first 3 values are the rgb values and the last is the alpha value. Quote Link to comment https://forums.phpfreaks.com/topic/154550-div-transparency/#findComment-813434 Share on other sites More sharing options...
jcombs_31 Posted April 19, 2009 Share Posted April 19, 2009 I think the easiest and better solution is to use a transparent png. Quote Link to comment https://forums.phpfreaks.com/topic/154550-div-transparency/#findComment-813793 Share on other sites More sharing options...
Axeia Posted April 19, 2009 Share Posted April 19, 2009 I think the easiest and better solution is to use a transparent png. *nods* At least it will work in all browsers (excluding IE <= 6) Quote Link to comment https://forums.phpfreaks.com/topic/154550-div-transparency/#findComment-813834 Share on other sites More sharing options...
jackpf Posted April 19, 2009 Share Posted April 19, 2009 Anyone still using that deserves to be brutally slaughtered. Quote Link to comment https://forums.phpfreaks.com/topic/154550-div-transparency/#findComment-813926 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.