JSFiddle - React, Tailwind, and code Playground

by iamacatperson

HTML

<div id="wrapper">
    
    <div class="box small">
        <p>This is some sample text.</p>
    </div>
    <div class="box small">
        <p>This is some sample text.</p>
    </div>
    <div class="box small">
        <p>This is some sample text.</p>
    </div>
    
</div>

CSS

#wrapper {
    margin: 70px 0 0 70px;
}

.box {
    border: 1px solid #96C;
    float: left;
    width: 150px;
    background: #CCF;
    padding: 10px;
    cursor: pointer;
}

.small {
    height: 150px; 
}
.big {
    height: 180px; 
    top: -15px;
    position: relative;
}

JavaScript

$('.box').hover(function() {
    $(this).removeClass('small').addClass('big');
}, function() {
    $(this).removeClass('big').addClass('small');
});