соблюдайте структуру SASS.
это код SASS для вашей структуры:
#humberger {
position: relative;
height: 24px;
width: 24px;
display: inline-block;
box-sizing: border-box;
div{
position: absolute;
left:0;
height:4px;
width: 24px;
background-color: #444;
border-radius: 2px;
box-sizing: border-box;
transition: all 0.3s;
&:nth-of-type(1){
top:0;
}
&:nth-of-type(2) {
top: 10px;
}
&:nth-of-type(3) {
bottom:0;
}
}
&:hover{
div{
&:nth-of-type(1){
transform: rotate(45deg);
top: 0;
bottom: 0;
margin: auto;
}
&:nth-of-type(2){
transform: translateX(100px);
background: rgba(255, 255, 255, 0);
}
&:nth-of-type(3){
transform: rotate(-45deg);
top: 0;
bottom: 0;
margin: auto;
}
}
}
}
это фрагмент кода с обычным css.
#humberger {
position: relative;
height: 24px;
width: 24px;
display: inline-block;
box-sizing: border-box;
}
#humberger div {
position: absolute;
left: 0;
height: 4px;
width: 24px;
background-color: #444;
border-radius: 2px;
box-sizing: border-box;
-webkit-transition: all 0.3s;
transition: all 0.3s;
}
#humberger div:nth-of-type(1) {
top: 0;
}
#humberger div:nth-of-type(2) {
top: 10px;
}
#humberger div:nth-of-type(3) {
bottom: 0;
}
#humberger:hover div:nth-of-type(1) {
-webkit-transform: rotate(45deg);
transform: rotate(45deg);
top: 0;
bottom: 0;
margin: auto;
}
#humberger:hover div:nth-of-type(2) {
-webkit-transform: translateX(100px);
transform: translateX(100px);
background: rgba(255, 255, 255, 0);
}
#humberger:hover div:nth-of-type(3) {
-webkit-transform: rotate(-45deg);
transform: rotate(-45deg);
top: 0;
bottom: 0;
margin: auto;
}
<div id="humberger">
<div onclick='openNav()'></div>
<div onclick='openNav()'></div>
<div onclick='openNav()'></div>
</div>
<span class='icon-title'>Open</span>
приведенный выше код SASS работает так же, как и фрагмент.
Надеюсь, этот ответ будет вам полезен.
Спасибо ...