Facebook Style Dropdown Menu - V2
This is a modified version of original facebook style dropdown menu that was posted a long time ago. The problem in the original version is that the page jumps to the list when it is clicked because of :target
selector. So here I used the checkbox hack to prevent the page from jumping to the list and still functions the same (or slightly better).
Initially, the checkbox is hidden and the label for it is used to trigger the checkbox. When it is checked, the list is set to display: block
so that it becomes visible. It's a pretty neat technique that will work in almost all the major browsers. Take a look at the code to understand more about it.