I want to set the opacity of an element to 0. Now if i do this, all the content of the element will inherit this property. I don't want this, i just want the background to get the opacity 0 while the content (the text for example) stays visible
Any clues ?
Thanks.
background-color:rgba(55,55,255,0.5); //here i use rgba for color and opacity. for more transparency we can use 0.4 or 0.3,...., box-shadow:2px 2px 2px 2px #999999; }
#0000ffff - that is the code that you need for transparent.
Changing the opacity of the background color only To achieve this, use a color value which has an alpha channel—such as rgba. As with opacity , a value of 1 for the alpha channel value makes the color fully opaque. Therefore background-color: rgba(0,0,0,. 5); will set the background color to 50% opacity.
First, we create a <div> element (class="background") with a background image, and a border. Then we create another <div> (class="transbox") inside the first <div>. The <div class="transbox"> have a background color, and a border - the div is transparent.
After some research I found an easy answer - background-color: transparent;
Can you set the background color instead?
background-color: rgba(255,255,255,0.6);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With