I am working on a design that involves a circle and text grouped together. There are 3 possible situations I need to implement:
1. When neither element is hovered over, only the circle should be visible.
2. When the circle is hovered over, both the circle and the linked text should appear.
3. When the text is hovered over, only the circle should remain visible.
So far, I have been able to successfully implement the first two scenarios as shown below:
.shape_text:hover .text {
opacity: 1;
}
.text {
opacity: 0;
}
.text:hover {
opacity: 0;
}
<svg width="250" height="250">
<g class="shape_text">
<circle cx="30" cy="45" r="25" />
<text class="text" x=0 y=100>That's a circle</text>
</g>
</svg>