Am I doing this wrong? | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
+ 4

Am I doing this wrong?

I always get this alert, and it starts to annoy me. Am I doing something wrong if I use rgba, or what? I don't get it... https://imgur.com/nkeXypt

16th Dec 2019, 8:00 PM
🍇 Alex Tușinean 💜
🍇 Alex Tușinean 💜 - avatar
2 Réponses
+ 7
Not all browsers support rgba, so if you try to run this code on a browser that doesn't, it will not display the background correctly. To avoid that, you should specify another fallback (or backup) background, with rgb or hex, because it is supported by older browsers. By default, browsers will always use the last specified value, so it's not a problem: background-color: rgb(0, 0, 0); background-color: rgba(0, 0, 0, 0.8); Use both of the above lines in your code, it should be fixed.
16th Dec 2019, 8:12 PM
Aymane Boukrouh
Aymane Boukrouh - avatar
+ 2
Hello, I would suggest that every browser has a different decoding of CSS. So, It may happen that some browser is not supporting rgba(). I suggest you use different styles for different browsers. Or you can also use different properties for the same. Like first apply background-color and then apply opacity property.
17th Dec 2019, 6:30 AM
Ishan Shah
Ishan Shah - avatar