I am facing an issue where the descriptions in my list of 100 items are longer than the width of the div, causing the text to be cut off. I want to display the full description on hover without affecting the layout of other items. Currently, when I hover over one item, all the items below it shift downwards. I need a solution that moves only the hovered item forward while keeping the rest in place.
<div class="album-item">
<div class="album-img"><img src="https://is1-ssl.mzstatic.com/image/thumb/Music124/v4/1a/69/cf/1a69cf82-2cfe-a7e1-a79c-cb9d7d67b710/886447513651.jpg/170x170bb-85.png"></div>
<div class="album-card">
<div class="name">Rent (Original Soundtrack of the Fox Live Television Event)</div>
<div class="artist">Original Television Cast of Rent Live</div>
<div class="date">February 1, 2019</div>
</div>
</div>
<div class="album-item">
<div class="album-img"><img src="https://is1-ssl.mzstatic.com/image/thumb/Music124/v4/1a/69/cf/1a69cf82-2cfe-a7e1-a79c-cb9d7d67b710/886447513651.jpg/170x170bb-85.png"></div>
<div class="album-card">
<div class="name">Rent (Original Soundtrack of the Fox Live Television Event)</div>
<div class="artist">Original Television Cast of Rent Live</div>
<div class="date">February 1, 2019</div>
</div>
</div>
.album-item {
background-color: gray;
width: 170px;
margin: 25px;
}
img {
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
border-radius: 5px;
-webkit-transition: all 0.6s cubic-bezier(0.15, 0.8, 0.4, 1);
transition: all 0.6s cubic-bezier(0.15, 0.8, 0.4, 1);
opacity: 0.8;
border: 1px solid transparent;
&:hover {
-webkit-transform: scale(1.1, 1.1);
transform: scale(1.1, 1.1);
opacity: 1;
border-color: yellow;
cursor: pointer;
}
}
.album-card {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
&:hover {
color: yellow;
white-space: normal;
height: 100%;
}
.name {
font-size: 110%;
font-weight: 550;
}
.artist {
font-weight: 300;
}
.date {
font-weight: 100;
font-style: italic;
font-size: 80%;
}
}
My goal is to have the image description displayed on top of the corresponding image without causing any movement in the entire list layout.