Im working on the opacity of an element using css. a paragraph is place in a div but when i set the opacity of the div to 0.4 the paragraph also affect. I tried to override the div in the paragraph by asigning the opacity 1.0 by this doesnt work. How can I solve this?
Share
The short answer is that you can’t. That is just how opacity works.
A longer answer depends on what are you actually trying to achieve (the old XY Problem).
If, for instance, you wanted the background of the div to be translucent, but not the paragraph then you could solve that by using a translucent background instead of making the entire div translucent.