TAG
CSS
Result
Run
License
<div class="box">Rollover me</div> <div class="box">Rollover me</div>
.box { position: absolute; width: 100px; height: 100px; background-color: red; left: calc((100vw - 100px) / 2); top: 100px; transition: 0.3s; display: flex; justify-content: center; align-items: center; } .box:nth-child(1):hover { transform: rotate(atan(1)); /* 45degree */ } .box:nth-child(2) { top: 250px; } .box:nth-child(2):hover { transform: rotate(atan(-infinity)); /* -90degree */ }
Console
expand_less
License
License
by DevDic
Close