0

This is the code the opacity isn't working help please.

<html>
<style>
body {
   z-index: -1;
   opacity: 20%;
}
</style>
<body>
<body class="my-container" style="background-image: url('https://i.ytimg.com/vi/3KNQfA21QyQ/maxresdefault.jpg');">

</body>
</html>
DaYroXy
  • 26
  • 7

2 Answers2

2

Set opacity in range: 0 to 1, for eg. 0; 0.1; 0.2 .... 0.9; 1.

andfra
  • 163
  • 11
0

Opacity doesn't work on the body element.

Add a <div> child and use whatever you were using for the body inside that div. Instant fix.

AMAN77
  • 6,218
  • 9
  • 45
  • 60