Hey everyone, I'm encountering an issue with animations. I have an image that transitions on hover, but the text just below it is moving slightly as well. This is causing layout problems for me. I attempted to use absolute positioning based on a similar solution I found, but it didn't solve the issue for me. Any suggestions on how I can fix this?
<div class="album-item">
<div class="album-img"><img src="https://is2-ssl.mzstatic.com/image/thumb/Music114/v4/97/e6/70/97e670f6-361b-a23d-617a-52bafcd631cd/075679854247.jpg/170x170bb-85.png" /></div>
<div class="album-card">
<h4>title</h4>
<span>name</span> <span>released</span>
</div>
</div>
.album-item {
background-color: gray;
width: 170px;
margin: 25px;
}
h4 {
align-content: center;
margin: 5px;
}
.album-img {
}
img {
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
border-radius: 3px;
-webkit-transition: all 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
transition: all 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
opacity: 0.8;
}
img:hover {
-webkit-transform: scale(1.12, 1.12);
transform: scale(1.12, 1.12);
opacity: 1;
border: 1px solid yellow;
border-radius: 2px;
cursor: pointer;
}
.album-card {
}
The text seems to be moving slightly in this example, and I have multiple tiles like this, causing significant layout issues. I really need the text to remain stationary.