0

Why "empty-div" don't change background-color?

div.empty-div { position: relative; background-color:blue; height: 100px; width: 100px; margin: 30px; padding: 10px; border: 1px solid black; } div.green-div { position: absolute; background-color: #8bc34a; border: 1px solid white; width:100%; height:100%; top:-1px; left:-1px; } div.green-div:hover{ transform: rotate(25deg); transform-origin: 0% 100%; -webkit-transform: rotate(25deg); -webkit-transform-origin: 0% 100%; transition:transform 3s ease-in-out; } <div class="empty-div"> <div class="green-div"></div> </div>

31st Jan 2019, 4:22 PM
Andriy Halychanivskyi
Andriy Halychanivskyi - avatar
4 Answers
+ 1
It's changed to blue, but you can't see it, because the green-div is on top of the empty-div.
31st Jan 2019, 5:16 PM
Boris Batinkov
Boris Batinkov - avatar
+ 1
Use higher z-index for the green div.
31st Jan 2019, 5:40 PM
Boris Batinkov
Boris Batinkov - avatar
+ 1
It's alive) Thanks.
31st Jan 2019, 5:56 PM
Andriy Halychanivskyi
Andriy Halychanivskyi - avatar
0
How can i solve it?
31st Jan 2019, 5:22 PM
Andriy Halychanivskyi
Andriy Halychanivskyi - avatar