How to create a Menu Icon with CSS?



To create a Menu Icon with CSS, the code is as follows −

Example

 Live Demo

<!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style> div {    width: 40px;    height: 7px;    background-color: blue;    margin: 5px 2px; } </style>> </head> <body> <h2>Sample Menu Icon</h2> <div></div> <div></div> <div></div> </body> </html>

Output

This will produce the following output −

Updated on: 2020-04-03T07:30:34+05:30

942 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements