5
I wonder how I can make the event :Hover in one element take effect in another... I have the following code:
<ul>
<a href="#">
<li>
<div id="search-image"><img src="images/image.jpg"/></div>
<h1>Título</h1>
<div id="search-bottom">
<p class="price"><b>R$</b> XXX</p>
<p class="deal">Texto</p>
<p class="date">xx/xx/xx</p>
</div>
</li>
</a>
</ul>
I would like to put a border and change the title color h1
to have the effect Hover in the element <li>
.
You can also use pure css to affect elements that are not children of the element that receives Hover, as long as it is possible to reference it. An example would be using + to reference a tag that is "sister" to the tag that gets the Hover.
– ndvo
Thank you, I’m going to style this element Li and put a border around it, only when the effect occurs it kind of distorts, as in this example you made, how do I make it still? And thank you again :)
– Thiago
And how to make this effect on more than one element? for example, I would like to increase the size of the image inside the "search-image" div with the Transform: Scale() in the Hover effect in the li element as well.
– Thiago
The idea is the same:
li:hover img { /*estilo da imagem*/ }
, I edited the answer, look at that– GilCarvalhoDev