CodeNewbie Community 🌱

Valeriya Polyakova
Valeriya Polyakova

Posted on

Looking for a simple 2-level menu

I'm looking for a simple 2-level menu that is able to change color and size through the use of CSS. I want the menu to appear in the left part of the page, be opened by clicking the burger icon, and be closed by clicking the cross or someplace outside the menu. It has to function on both smartphones and desktops.

I have already discovered lots of solutions, but they are all too complicated for me to implement.

Can you please tell me where I can find such a tool?

Latest comments (2)

Collapse
 
getlexsavet profile image
getlexsavet

You can easily build a simple 2-level menu with HTML, CSS, and a touch of JavaScript without relying on heavy frameworks—just use a hidden sidebar that slides in from the left when the burger icon is clicked, style it with CSS for color and size changes, and add a small script to close it when the cross or outside area is clicked; this approach works smoothly on both smartphones and desktops, and you can find beginner-friendly examples on sites like W3Schools or CodePen that are far simpler than most advanced libraries, almost like checking quick updates such as A&W specials today without digging through complicated menus.

Collapse
 
terabytetiger profile image
Tyler V. (he/him)

Two level menus are inherently a bit tricky because of managing accessibility with it, and as far as I know, will require at least some amount of JavaScript.

Is there a specific library/framework you're working with (CSS and/or JS)?