There’s no way in 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 way out would be to put one div
extra in the input
, and in this div
move the image up.
Now, if you want to make a tooltip, there are other ways:
It is possible to make a tooltip with pure CSS?