0
Opacity
Does this also work with borders and text or just images?
2 Antworten
+ 4
The opacity property applies to full elements - You can use it on divs, paragraphs, etc. However, borders are part of an element, so applying opacity on that element would not only affect the border but also the element. The workaround would be to use rgba as part of the border definition.
border: 5px solid rgba(255, 0, 0, 0.5);
This would set the border at 50% opacity.
+ 3
Yes, it is work for all the elements.
You can see some examples here,
https://www.w3schools.com/cssref/css3_pr_opacity.asp
Good Luck~