is correct. You have not added the Styles to the Page. As a result, it is not showing as expected.
Just to show, how it works, refer the demo with your code (I have just added red background) - [Demo] DropDown Menu with HTML and CSS
See that, it is working perfectly. You just need to add the CSS Styles to the Page.