0

I am want transparency a screen and show the screen behind

my css:

.correct-answer {
  background-color: #98CB66;
  filter: alpha(opacity=60);
  z-index: 10;
  opacity: 0.7; 
  height: 100%;
  width: 100%;
}

i tried use alpha filter in css, and its not working

2 Answers2

0

if you just want to apply opacity to background-color then you could convert your hex to rgb and use it with alpha

 background-color : rgba(152,203,102,0.6);

In another case, if you want to apply opacity to whole block, then use CSS3 filter property.

 -webkit-filter: opacity(60%); /* Safari 6.0 - 9.0 */
 filter : opacity(60%);
the_mishra
  • 813
  • 9
  • 24
-1

Try Below CSS Snipet :

.yourselector {
background:#000;
opacity: .75; /* standard: ff gt 1.5, opera, safari */
-ms-filter: “alpha(opacity=75)”; /* ie 8 */
filter: alpha(opacity=75); /* ie lt 7 */
-khtml-opacity: .75; /* safari 1.x */
-moz-opacity: .75; /* ff lt 1.5, netscape */
}
LuFFy
  • 8,799
  • 10
  • 41
  • 59
MD.ALIMUL Alrazy
  • 330
  • 1
  • 7
  • 17
  • 2
    While this code snippet may solve the question, including an explanation really helps to improve the quality of your post. Remember that you are answering the question for readers in the future, and those people might not know the reasons for your code suggestion. Please also try not to crowd your code with explanatory comments, this reduces the readability of both the code and the explanations! – Rohan Khude Dec 06 '17 at 11:03