how to make a transparent div background without effects other elements in that div ?
Itried the opacity but the all elements were effected
how to make a transparent div background without effects other elements in that div ?
Itried the opacity but the all elements were effected
3
Answers
If it is just a matter of background, you could use something like
color: rgba(0,0,0,0)
to get a transparent background. If you need to make also the text inside the div transparent, I think the only thing you can do is to move out the divs from the parent div and play with positioning to get the visual you want.The
opacity
property will affect the child elements indeed, since they will inherit the same transparency from the parent element (a principle in CSS).This can be solved with the
rgba
function with thebackground-color
property:Actually, the background of divs is transparent by default (?):