I am making a document in a grid format and when I hover over the image I want to have an overlay, it randomly goes underneath it. How would I bring this effect higher up on the document. (The first image in the only one with the effect currently). HTML won't display in a code block here for some reason so I attached my codepen, thank you everyone!
.flex {
display: grid;
grid-gap: 2rem;
grid-template-columns: repeat(3, 1fr);
margin: 0% 5% 5% 5%;
}
.resize {
max-width: 100%;
}
.overlay {
position: absolute;
bottom: 0;
left: 0;
right: 0;
background-color: cyan;
overflow: hidden;
width: 28%;
height: 0;
transition: .5s ease;
opacity: 0.3;
margin: 0% 0% 0% 5%;
}
.contained1:hover .overlay {
height: 35%;
width: 28%;
margin: 0% 0% 0% 5%;
}
.text {
color: white;
font-size: 20px;
position: absolute;
top: 90%;
left: 50%;
transform: translate(-50%, -50%);
text-align: center;
font-family: 'karla';
}
CODE PEN: https://codepen.io/daniel-albano/pen/vYOKRzp?editors=1100