I want to animate two images within my #header div. Currently, when you hover over the individual images, they move to their respective positions. But I want to move my first image down and my second image up at the same time - when hovering over the #header div.
.set {
position: relative;
top: -15px;
transition: top ease 0.5s;
}
.set:hover{
top: 15px;
}
.rise {
position: relative;
top: 0;
transition: top ease 0.5s;
}
.rise:hover {
top: -15px;
}
<div id="header">
<header>
<h1>My Title!</h1>
<img src="https://i.pinimg.com/originals/71/ba/35/71ba3562bc89f6a11e5d5625da09bfeb.png" alt="sun" width="100px" class="set">
<img src="https://i.ibb.co/z6PQ7qX/moon.png" alt="moon" width="100px" class="rise">
</header>
</div>