JSFiddle - React, Tailwind, and code Playground
by CamaroSS
HTML
<div class="arena">
<div class="get-over-here"></div>
<div class="object"></div>
</div>
CSS
.arena {
width: 400px;
height: 200px;
background-color: #eee;
position: relative;
}
.get-over-here {
position: absolute;
top: 50px;
right: 20px;
color: #000;
text-align: center;
font-size: 10px;
background-color: yellow;
width: 50px;
height: 50px;
-webkit-border-radius: 25px;
-moz-border-radius: 25px;
border-radius: 25px;
-moz-transition: 2s ease-out;
-webkit-transition: 2s ease-out;
transition: 2s ease-out;
}
.object {
position: absolute;
top: 50px;
right: 300px;
width: 70px;
height: 50px;
color: #fff;
font-size: 12px;
padding-top: 1em;
text-align: center;
background-color: purple;
-moz-transition: 3s ease-out;
-webkit-transition: 3s ease-out;
transition: 3s ease-out;
}
.get-over-here:hover {
background-color: orange;
}
.get-over-here:hover + .object {
right: 10px;
}
.object:hover {
right: 10px;
}
.object:hover:after {
content: "Hovered";
}