Opacity is used to show or hide the html element.
For Example 0 for hide and 1 for show.
<p style="opacity: 0">Show Me</p> //will not show on the page
<p style="opacity: 0.5">Show Me</p>
<p style="opacity: 1">Show Me</p>
The Opacity declaration sets how opaque an element is. An opacity value of 1 means the element is fully opaque; an opacity value of 0 means an element is not at all opaque, i.e. fully transparent.This elements opacity is 0.5!
Note that both the text and the background-color are affected by the opacity level.
Asked In: Many Interviews |