JSFiddle - React, Tailwind, and code Playground
HTML
<div class="wrap">
<div class="wrapper"><div class="item a">A</div></div>
<div class="wrapper"><div class="item b">B</div></div>
</div>
CSS
.wrapper {
display: inline-block;
height: 100px;
margin: 20px;
position: relative;
width: 100px;
}
.item {
color: white;
display: inline-block;
font-family: Calibri, Arial;
font-size: 32px;
line-height: 100px;
position: absolute;
text-align: center;
width: 100px;
z-index:1;
-webkit-transition: all 1s ease-in-out;
-moz-transition: all 1s ease-in-out;
}
div.item:hover {
padding-right: 100px;
z-index: 9999;
}
.a {background:red;}
.b {background:blue;}