I want to change a images style when hovering a text inside the common container. This works when the whole container is hover sensitive, like in my fiddle here: https://jsfiddle.net/0hans3q5/5/
.container {
width: 200px;
margin: 20px;
}
.container:hover img {
border: 2px solid red;
}
<div class="container">
<a href="#"><img src="https://cdn1.medicalnewstoday.com/content/images/articles/277/277169/mouse.jpg" /></a>
<h1>header</h1>
Dessert dragée biscuit croissant tootsie roll gummies marshmallow. Bear claw topping tart candy lemon drops apple pie tootsie roll marzipan.
<br />
<div class="inforoller">
<a href="#">more information</a></div>
</div>
I would like to show the border only when hovering the text "more information. I tried it that way:
.container {
width: 200px;
margin: 20px;
}
.inforoller:hover .container img {
border: 2px solid red;
}
<div class="container">
<a href="#"><img src="https://cdn1.medicalnewstoday.com/content/images/articles/277/277169/mouse.jpg" /></a>
<h1>header</h1>
Dessert dragée biscuit croissant tootsie roll gummies marshmallow. Bear claw topping tart candy lemon drops apple pie tootsie roll marzipan.
<br />
<div class="inforoller">
<a href="#">more information</a></div>
</div>
Is there a possibility to make this work just with css? I know there are js solutions....