So, I've been trying to use an hamburger menu I made from 3 stacked div tags as a mask for a background with a color gradient (the red/yellow one, the blue/violet one is the main background). The result I would like to achieve is this: result I know I could simply use a svg file of the hamburger, but I would like to do this with the div tags I made so I can later animate them to transition in a x icon, as this whole thing is to create a sidebar.
html, body {
height: 100%;
background: linear-gradient(-45deg, #c850c0, #4158d0);
font-family: 'Poppins', sans-serif;
font-size: 20px;
}
.hamburger{
background: linear-gradient(-45deg, #faf617, #ff0000);
width: 50px;
height: 40px;
position: absolute;
top: 20px;
padding: 1px;
left: 20px;
}
.line{
width: 30px;
height: 4px;
margin: 7px;
border-radius: 2px;
display: block;
background-color: #ffffff;
}
<div class="hamburger">
<div class="line"></div>
<div class="line"></div>
<div class="line"></div>
</div>