View Full Version : Controlling OnClick event with CSS

Nov 8th, 2006, 10:52 AM
I'm trying to creat a horizontal tab menu which should show the submenu on clicking any of the Main menu TAB.
I think I should make Divs with Display:none; on static mode & when someone clicks on the button or link the DIV should be appear.
But the problem is, how can I control the Onclick event with CSS???
I dont wanna use Javascript, I want to do this in CSS.
Somebody please guide me...!

Nov 8th, 2006, 12:33 PM
Not sure if this is what you are after...but here is a tutorial from BonRouge (http://bonrouge.com/br.php?page=cssonclickswitch#n)which does something similar to what you are after.

good luck

Mar 7th, 2011, 12:19 PM
Stumbled on this while trying to do something similar to the OP. I also found the Bon Rouge tute useful (http://bonrouge.com/br.php?page=cssonclickswitch). There's also a much simplified but less functional example at As I Learn (http://www.asilearn.net/asilearn/tutorial/css-onclick-kind-of/).
Hope thats useful to anyone else who comes across this