divinedesigns1 Posted May 7, 2012 Share Posted May 7, 2012 hello, i am having a little problem, is there a way to make the background transparent but not the text? i know how to make the background transparent but the text gets transparented also "the text gets transparent also <-- doesnt make sense to me, but i hope you get what im saying" anyway how do i avoid making the text transparent but end up making the background transparent only? I am just testing my knowledge hehehe Link to comment Share on other sites More sharing options...
dsonesuk Posted May 7, 2012 Share Posted May 7, 2012 (edited) ??? apply transparent background, background-color: transparent; remove background color or image ie ALL background: none; EDIT: if you are using opacity, and IE crappy filter blah blah, IT and ALL its child elements become transparent also; Edited May 7, 2012 by dsonesuk Link to comment Share on other sites More sharing options...
divinedesigns1 Posted May 7, 2012 Author Share Posted May 7, 2012 ok i think i explained that wrong hehehe, i did background:#976548;filter:alpha(opacity=20); but the text opacity went to 20 also 0.o i just wanted the background to change the opacity Link to comment Share on other sites More sharing options...
dsonesuk Posted May 7, 2012 Share Posted May 7, 2012 Give the container on which you want to use opacity a position: relative;, within that create EMPTY div and and give id ref "trans_bg" #trans_bg{position: absolute;left:0;top:0;right:0;bottom:0background:#976548;opacity:0.20;filter:alpha(opacity=20);} you may need to apply z-index: to force this below text. Link to comment Share on other sites More sharing options...
divinedesigns1 Posted May 7, 2012 Author Share Posted May 7, 2012 thank you onces again dsone Link to comment Share on other sites More sharing options...
ckrudelux Posted May 7, 2012 Share Posted May 7, 2012 hello, i am having a little problem, is there a way to make the background transparent but not the text? i know how to make the background transparent but the text gets transparented also "the text gets transparent also <-- doesnt make sense to me, but i hope you get what im saying" anyway how do i avoid making the text transparent but end up making the background transparent only?You could use rgbabackground: rgba(0,0,0,0.5); Link to comment Share on other sites More sharing options...
Ingolme Posted May 7, 2012 Share Posted May 7, 2012 I don't like creating extra elements for styling if I can avoid it. You can make a 1x1 pixel semi-transparent PNG as a background image if you want to support browsers that don't accept rgba format. Link to comment Share on other sites More sharing options...
dsonesuk Posted May 7, 2012 Share Posted May 7, 2012 Personally I don't like creating unnecessary bg images, when background-color: with opacity, works just fine! Also works in ALL browsers AND also where i can change transparent colour instantly without the need for creating a new image everytime! But! its just my preference. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now