I am trying to make a title appear over an image when you hover over it, but they both have to have the same class. I have no clue what I am asking is even possible or not, but I would consider a variety of different solutions. This is what I currently have.
<div class="item">
<img class="Placeholderimg" src="placeholder.jpg">
<div class="hovershow1">
<div class="title">
Testing1
</div>
</div>
</a>
</div>
<div class="item">
<img class="Placeholderimg" src="placeholder.jpg">
<div class="hovershow2">
<div class="title">
Testing2
</div>
</div>
This is my css
.item{
height: 156px;
width: 156px;
}
.Placeholderimg{
height: 156px;
width: 156px;
border-radius: 10px;
}
.hovershow1{
visibility: hidden;
position: absolute;
top:0;
height: 156px;
width:156px;
background-color: rgba(40, 40, 40, 0.4);
border-radius: 10px;
}
.item:hover .hovershow1{
visibility:visible;
}
.hovershow2{
visibility: hidden;
position: absolute;
top:0;
height: 156px;
width:156px;
background-color: rgba(40, 40, 40, 0.4);
border-radius: 10px;
}
.item:hover .hovershow2{
visibility:visible;
}