Ваши position
и margin-bottom
являются причинами проблемы.
update
.infobar {
cursor: default;
font-size: 0.9rem;
font-weight: lighter;
padding: 10px;
text-align: left;
width: 100%;
height: 30%;
position: relative;
transition: .3s ease-in-out;
background: #413a44;
}
.viewBar img {
position: relative;
left: 0;
bottom: 0;
transition: .32s ease-in-out;
}
remove
.viewBar:hover img {
bottom: 30%;
}
UPDATED
установите вашу позицию .item
на relative
.item{
position: relative;
}
, затем .infobar
на absolute
.Я также изменил height
margin-bottom
padding
, чтобы достичь желаемого эффекта
.infobar {
cursor: default;
font-size: 0.9rem;
font-weight: lighter;
text-align: left;
width: 100%;
/* updates */
height: 0;
position: absolute;
z-index: 1;
bottom: 0;
/* end updates */
transition: .3s ease-in-out all;
background: #413a44;
}
Затем на .item:hover
.item:hover .infobar {
height: 30%;
}
измените продолжительность transition
назначения p
до .3s
такие же, как .infobar
для получения более плавного эффекта.
.infobar p {
opacity: 0;
margin: 0;
transition: .3s ease-in-out;
}
Надеюсь, это поможет.
здесь ручка https://codepen.io/crazychukz/pen/VJyOJj