divinedesigns1 Posted March 9, 2014 Share Posted March 9, 2014 i have a few divs which is transparent but the text also becomes transparent, how can i undo this or make it just so the div can be transparent and not the font also background-image: -ms-linear-gradient(top, #F9FF4F 5%, #EFE703 100%); background-image: -moz-linear-gradient(top, #F9FF4F 5%, #EFE703 100%); background-image: -o-linear-gradient(top, #F9FF4F 5%, #EFE703 100%); background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #F9FF4F), color-stop(1, #EFE703)); background-image: -webkit-linear-gradient(top, #F9FF4F 5%, #EFE703 100%); background-image: linear-gradient(to bottom, #F9FF4F 5%, #EFE703 100%); opacity:0.6; filter:alpha(opacity=60); the above code is what im using, but this is making the text also transparent. Link to comment Share on other sites More sharing options...
Ingolme Posted March 9, 2014 Share Posted March 9, 2014 The opacity property makes the entire element transparent, as a result the text inside it also has opacity. If you just want the background transparent rather than the element itself you can use rgba() color codes. http://www.w3schools.com/cssref/css_colors_legal.asp Link to comment Share on other sites More sharing options...
divinedesigns1 Posted March 9, 2014 Author Share Posted March 9, 2014 The opacity property makes the entire element transparent, as a result the text inside it also has opacity. If you just want the background transparent rather than the element itself you can use rgba() color codes. http://www.w3schools.com/cssref/css_colors_legal.asp Thanks Ingolme, that work perfect Link to comment Share on other sites More sharing options...
kelly2marie Posted March 16, 2014 Share Posted March 16, 2014 Use RGBa color codes. The a is "alpha" for opacity. The text will not inherit this opacity. RGBa: Red - Green - Blue - Opacity div {background-color: rgba(0, 0, 0, .5); The above rgb code is black, and the opacity level is set to .5 or 50%. Link to comment Share on other sites More sharing options...
MarkT Posted March 18, 2014 Share Posted March 18, 2014 The opacity property makes the entire element transparent, as a result the text inside it also has opacity. If you just want the background transparent rather than the element itself you can use rgba() color codes. http://www.w3schools.com/cssref/css_colors_legal.asp You could use <div style="opacity: 0.3;">Opacity Bit here <div style="opacity: 1;">Normal</div></div> should work, i think. 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