There is no way for CSS to affect parent elements.
For modern browsers, you can pass the hover out of the input: .nav:hover { }
and .nav:hover .img__logo { }
:
.nav {background:gray;padding:10px}
.nav .img__logo {background:blue;min-height:10px}
.nav:hover {background:teal}
.nav:hover .img__logo {background:red}
<div class="nav">
<div class="img__logo"></div>
<input class="form__login"/>
</div>
Another output would be to put an extra div
in the input
, and in this div
move the image up.
Now, if you want to make a tooltip, you have other ways:
Is it possible to make a tooltip with pure CSS?