I am attempting to modify a display
property upon hovering over another div.
.pc-hover {
display: none;
}
.pc-content-image img:hover + .pc-hover {
display: block;
}
<div class="profile-content">
<div class="pc-hover">{hover}</div>
<div class="pc-header">{head}</div>
<div class="pc-content">
<div class="pc-content-image">
<img src="https://via.placeholder.com/300" alt="placeholder" />
</div>
<div class="pc-content-text">
<p>{text}</p>
<p>{text2}</p>
</div>
</div>
</div>
Initially, the pc-hover
element remains hidden until the mouse hovers over the image within the pc-content-image
div. However, nothing occurs when I hover over the image.
I have looked into resources like Using only CSS, show div on hover over another element, but I am unsure how to implement it.
I have tried using both +
and ~
, but with no success.
Is there a method to accomplish this? Any assistance would be greatly appreciated, thank you.