Welcome to the Treehouse Community
The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Carlos Serrano
3,351 PointsResponsive menu toggle
Hello everyone. I'm following the CSS Responsive Navigation Menu post from Treehouse's Blog:
http://blog.teamtreehouse.com/create-an-absolute-basic-mobile-css-responsive-navigation-menu
and was wondering how to make the menu display by clicking instead of :hover.
thank you,
2 Answers

Victor Rodriguez
15,015 PointsClick events are really meant for javascript, not for css. onclick(someFunction) for javascript. I don't think there is a :click for css3 actually. However I may be wrong. I do know that you can create a hack by using a hidden checkbox and the :checked selector. but as far as click events go, that is better used for javascript.

Jeremy Williams
9,078 PointsYou could try :active but that will only keep the menu open as long as the mouse button is pressed I believe.

Carlos Serrano
3,351 PointsThank you Jereny
Keith Kelly
21,326 PointsKeith Kelly
21,326 PointsTo expand on what Victor said although you can do somethings with css like animations, it's primary purpose of that language is styling. What you are looking for is a behavior which would be handles with JavaScript.
Each language you use to create web pages serves a specific purpose.
Carlos Serrano
3,351 PointsCarlos Serrano
3,351 PointsThank you Victor and Kelly. I'll start experimenting with JS.