I want to create a hover mechanism where hovering on one div will result in changing the width of another div as below
HTML
<div id='Slider_1'></div>
<div id='Footer_Holder'></div>
CSS
#Slider_1 {
color: #ffffff;
background-color: blue;
text-align: center;
transition: width 1s ;
width: 0%;
height: 130px;
z-index: 10;
}
#Footer_Holder {
background-color: red;
width: 150px;
height: 150px;
}
#Footer_Holder:hover + #Slider_1 {
width: 100%;
}
Code pen link - https://codepen.io/Volabos/pen/dyyMqzy
Surprising above code is working if I change the placements of div as below -
Can you please guide me to the right direction where I want to put <div id='Slider_1'>
on top of <div id='Footer_Holder'></div>