I am trying to create a spin animation for my hamburger icon and it refuses to work for whatever reason. I have even tried putting it as ".hamburger a:hover" and nothing seems to work. Can anyone find the solution please?
CSS
HTML
I am trying to create a spin animation for my hamburger icon and it refuses to work for whatever reason. I have even tried putting it as ".hamburger a:hover" and nothing seems to work. Can anyone find the solution please?
CSS
HTML
Change .hamburger :hover
to .hamburger:hover
- no space.
.hamburger a
means an element with a hamburger class that contains inside it an a
tag. You dont have that in your code. Change .hamburger a
to a.hamburger
- That measns an a
tag with the hamburger class.
Use the CSS display: inline-block
or display: block
so the element will have a width and height.
.hamburger {
position: relative;
font-size: 40px !important;
padding: 0px !important;
padding-left: 30px !important;
text-align: left !important;
color: #000;
text-decoration: none;
display: inline-block;
transition: 0.75 ease-in-out !important;
}
.hamburger:hover {
transform: scale(1.1) rotate(90deg) !important;
}
<div class="wrapper">
<div class="header">
<a class="hamburger" href="#" onclick="dropdown()"> ≡ </a>
</div>