I have a transition effect on a div that should be applied when hovering on another div.
I tried to use some selectors (+, >) I could not believe it's the way I'm using them
.box-toogle {
width: 100%;
height: 150px;
top: 0px;
position: relative;
transition: top 1s;
background-color: red;
}
.tgl {
position: relative;
top: 80px;
}
.cubo {
background-color: #0078e1;
border-radius: 50%;
box-shadow: 4px 7px 22px -9px rgba(0,0,0,0.25);
height: 30px;
width: 30px;
position: relative;
top: 90px;
left: 20px;
z-index: 1;
transition: 1s;
line-height: 30px;
text-align: center;
color: #eeeeee;
font-weight: bolder;
font-size: 18px;
cursor: pointer;
}
.cubo:hover {
background-color: #eeeeee;
color: #0078e1;
}
.cubo:hover + .box-toogle {
top: -120px;
}
<div class="box-toogle">
<h3 class="logo">Planejamento de Viagem</h3>
<div class="tgl">
<div >
<p>t>este</p>
</div>
</div>
<div class="cubo">X</div>
</div>