ARF Administrator Continuing Education

The ACS staff process applications for administrator certification and also approve/disapprove training vendors and their proposed courses. Our ARF Initial Administrator Certification Teaching…

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




Hamburger Menu CSS Animation Tutorial

A common web navigation element is the hamburger menu. I remember when it became common, and there were UX arguments about using it due to the fact that not everyone would know what it was. I think that argument has been put to bed since even my 3.5 year old daughter knows how to use a mobile app. Below I will give you a straight-forward way to add a hamburger menu with a nice CSS animation. It is something I have re-used on several sites, so I am also kind of putting it here so I know where to come back when I need it.

Not much to it. We are going to use the pseudo elements ::before and ::after to generate the hamburger menu with css.

This is where all the magic happens. All that is left for JS to do is to toggle the class of a parent element by “menu-active”.

What we are doing here is

And that is all there is to it!

I am becoming more and more a fan of this element. I am developing a site right now that uses this as hamburger menu and a slide out menu for both desktop and mobile design. It keeps the user experience consistent across devices, the design clean (even as new top level menu items are added), and it is a lot easier on a developer to only have to set up one menu instead of a top dropdown for desktop and a slide-out menu for mobile. Everybody wins!

And here is a complete gist:

Add a comment

Related posts:

Best IT Telecom Services in Houston TX

CNiC Solutions provides end-to-end IT support and security management services to empower and protect companies in Houston to leverage their IT infrastructure for success. CNiC works closely with its…

A Ten Hour Drive in Two Days

I really thought I could do it all. Decorating. Shopping. Baking. Holiday activities. Travel. Birthday celebration, that was a surprise, and 312 miles one way. Yoga every day. A plant based diet…

Is Social Media Really Bad For You?

The biggest question in the world of technology today, is social media really bad for you? As we know social media has a great number of cons and some pros. This question is mainly towards the…