0

The Opacity option not working?

The Code Is Given Below! There are two sections, one with The pic and Second empty, in second section i wanna add opacity of like rgba(239,69,9,0.5) but its not happening although simple white color is shown. dont know why! If you can alter my code and show, that would be really helpful! section 2 has and id="div2" which is in div element(look in css). https://code.sololearn.com/Wa60hJ1K98cq/?ref=app

29th Jul 2017, 9:40 AM
Shehzad
Shehzad - avatar
6 ответов
+ 2
Opacity works fine. The values for opacity is from 0 to 1 (e.g. 0.7). I've edited the two requested CSS to show you (I made #div2 background color black to make it easier to see the opacity working) Also, make your CSS tab spacing the same please. a img{ border:2px solid rgb(239,69,9); width:50%; border-radius:100%; margin:0px; position:absolute; padding:0px; top:30px; opacity: 0.1; } #div2{ background-color: black; height:300px; border:2px solid transparent; border-radius:50px 10px; position:relative ; margin-bottom:10px; opacity: 0.5; }
29th Jul 2017, 9:55 AM
God Usopp
God Usopp - avatar
+ 2
Try add opacity:0.5; in #div2
29th Jul 2017, 9:54 AM
Calviղ
Calviղ - avatar
+ 1
i am just stupid! I was adding opacity with rgb(239,69,9) and expecting it to work! Lol! Thank you Guys!!!!!!!!! wasted a lot of time doing that!
29th Jul 2017, 10:11 AM
Shehzad
Shehzad - avatar
+ 1
for #div2 you can also use rgba #div2{ background-color: rgba(256,256,256,0.8); }
29th Jul 2017, 10:19 AM
God Usopp
God Usopp - avatar
+ 1
yes, lol, i was firstly using this (239,39,9,0.7) and ended up as the same combination with no change in opacity! Thank you for helping me again!! really kind of you!
29th Jul 2017, 10:22 AM
Shehzad
Shehzad - avatar
+ 1
Helping you is helping me. I'm not very creative so I'm not very motivated to practice making webpages when I know I can't come up with fancy results.
29th Jul 2017, 10:28 AM
God Usopp
God Usopp - avatar