Burger menu icon

Developer
Size
2,374 Kb
Views
40,480

How do I make an burger menu icon?

What is a burger menu icon? How do you make a burger menu icon? This script and codes were developed by Alan Shortis on 14 November 2022, Monday.

Burger menu icon Previews

Burger menu icon - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Burger menu icon</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <a href="#" class="menu-button" id="js-menu-button"><span></span></a> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>

Burger menu icon - Script Codes CSS Codes

html, body { height: 100%;
}
body { display: flex; justify-content: center; align-items: center; background: #333;
}
.menu-button { position: relative; display: block; width: 25px; height: 25px;
}
.menu-button span { position: absolute; top: 50%; left: 0;
}
.menu-button span:before, .menu-button span:after { position: absolute; content: '';
}
.menu-button span:before { margin-top: -8px;
}
.menu-button span:after { margin-top: 8px;
}
.menu-button span, .menu-button span:before, .menu-button span:after { display: block; width: 25px; height: 2px; background: white; transition: all 200ms ease;
}
.menu-button--active span { background-color: transparent;
}
.menu-button--active span:before { margin-top: 0; background-color: white; transform: rotate(-45deg);
}
.menu-button--active span:after { margin-top: 0; background-color: white; transform: rotate(45deg);
}

Burger menu icon - Script Codes JS Codes

$('#js-menu-button').on('click', function(e) { e.preventDefault(); $(this).toggleClass('menu-button--active'); $('body').toggleClass('menu-open');
});
Burger menu icon - Script Codes
Burger menu icon - Script Codes
Home Page Home
Developer Alan Shortis
Username alanshortis
Uploaded November 14, 2022
Rating 3
Size 2,374 Kb
Views 40,480
Do you need developer help for Burger menu icon?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Alan Shortis (alanshortis) Script Codes
Create amazing art & images with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!