Image opacity problem 😥 | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
+ 2

Image opacity problem 😥

Hey .div{ width:100%; height:100vh; background-image:url(https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSYkraKMg7S1KIMbdjOUFlBVH8n8nvG5DOUVg&usqp=CAU); } I only want to change the opacity of image but instead it changes the opacity of whole div how to do it ???

21st May 2022, 7:21 AM
CODY RAZA ツ
CODY RAZA ツ - avatar
4 Respuestas
+ 1
Select only the image of d div in the css and use opacity Example div > img { Opacity:...; }
23rd May 2022, 1:57 AM
Mikeey
Mikeey - avatar
+ 4
Perhaps what you can do is to have an image element in the div element, and then make sure that the image element completely covers the div element. Then, apply the opacity parameter to it.
21st May 2022, 7:24 AM
👑 Prometheus 🇸🇬
👑 Prometheus 🇸🇬 - avatar
+ 2
👑 Prometheus 🇸🇬 can you write the code please
21st May 2022, 7:25 AM
CODY RAZA ツ
CODY RAZA ツ - avatar
- 1
Put a img tag into your div. Then style the img.
22nd May 2022, 9:48 AM
Ryan Zarif
Ryan Zarif - avatar