JSFiddle - React, Tailwind, and code Playground
HTML
<div class="box boxed js-box">
<div class="image_box">
<img src="/images/box-icon1.png" />
</div>
<div class="text_box">
<span class="text short js-box-text">
Title<br />
</span>
<span class="text long js-box-text">
Detailled description when hovered
</span>
</div>
</div>
CSS
.box {
background: #FFF;
cursor: default;
height: 168px;
margin-top: 30px;
padding: 4px;
text-align: center;
width: 184px;
display: table;
border: 1px solid #000;
}
.box > div {
display: table-row;
vertical-align: middle;
}
.box img {
border: 0;
display: block;
margin: auto;
margin-bottom: 24px;
position: relative;
top: 16px;
width: 76px;
}
.box .text {
bottom: 4px;
font-size: 12px;
position: relative;
}
.box .text.short {
font-size: 16px;
top: 8px;
}
.box .text.long {
display: none;
font-size: 14px;
}
JavaScript
$(function() {
$('div.text_box').hover(function() {
$(this).find('.short').hide();
$(this).find('.long').show();
}, function() {
$(this).find('.short').show();
$(this).find('.long').hide();
});
});