I have a row of items that transition in width using cubic-bezier. When hovering over the white gaps between the items the width glitches, getting larger and smaller very quickly. How do I fix? – https://codepen.io/reddragon303/pen/eYwvejY
<div class="grid">
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
</div>
* {
box-sizing: border-box;
}
html, body {
margin: 0;
}
.grid {
display: flex;
gap: 20px;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.item {
width: 300px;
height: 500px;
transition: width 0.5s cubic-bezier(.87,-1.38,.03,1.54);
background-image: url(https://cdn.pixabay.com/photo/2024/07/03/08/05/hot-air-balloon-8869138_1280.jpg);
background-size: cover;
background-position: center;
background-repeat: no-repeat;
overflow: hidden;
} .item:hover {
width:500px;
}
Thanks