I have an i tag which I'd like to style when hovering a button tag. This is my structure:
<a class="container">
<form>
<button class="origin">HOVER</button>
</form>
<p>
<i class="destination">TARGET</i>
<p>
</a>
Is this possible with CSS only? (I know how to do it with JS/jQuery)
I guess I'm looking to target the cousing element here, lol...
To be more specific, I'm looking to make the TARGET text color green when hovering the button:
<style>
a.container{ border: 1px solid black; display: block; }
a.container:hover{border-color: red; }
a.container:hover p i{color: yellow; }
a form button:hover{ color: red; }
a form button:hover p i{ color: green; } /* not working... */
.origin:hover .destination{ color: green; } /* not working... */
</style>
<a class="container">
<form>
<button class="origin">HOVER</button>
</form>
<p>
<i class="destination">TARGET</i>
<p>
</a>