catycat
New Coder
I am trying to display a little copyright text on top of an image when the user hovers his mouse over it, using [this](https://www.w3schools.com/howto/tryit.asp?filename=tryhow_css_image_overlay_opacity) example.
What am I missing that I do not see the text, only the fading effect?
This is my `css` file:
What am I missing that I do not see the text, only the fading effect?
Code:
<div class="list-group-item">
<div class="row">
<div class="col-12 col-md-4 vertical-center-col">
<img class="img-thumbnail" src="media/images/Carolin Zipp.jpg" alt="">
</div>
<div class="middle">
<div class="text">Image Copyright</div>
</div>
<div class="col-12 col-md-8 mt-2 mt-md-0">
<strong>BA. MA. Carolin Zipp</strong>
</div>
</div>
</div>
This is my `css` file:
Code:
.card-img-top {
min-height: 0.1px;
}
img.img-thumbnail {
border: 1px solid #e4c9c9;
width: 100%;
height: auto;
transition: 0.5s ease;
backface-visibility: hidden;
}
.middle {
transition: 0.5s ease;
opacity: 0;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
-ms-transform: translate(-50%, -50%);
text-align: center;
}
.text {
background-color: #04aa6d;
color: white;
font-size: 16px;
padding: 16px 32px;
}
.img-thumbnail:hover {
opacity: 0.3;
}
.img-thumbnail:hover .middle {
opacity: 1;
}