DEV Community

Discussion on: Create Drop-Down Menus with Plain CSS

Collapse
 
nikolab profile image
Nikola Betica

Details tag is not a correct semantic tag to use for navigation. You should always use nav tag. Also, in case of multi-level navigation details would not work correctly.

Collapse
 
Sloan, the sloth mascot
Comment deleted
 
nikolab profile image
Nikola Betica • Edited

It's a proof it works - sometimes. "Dropdown effect" is not the core behaviour of the details tag, it's a browser behaviour. Meaning - you don't have a control of how the browser will display that dropdown. Also, let's say you have a dropdown but you want the text that opens a dropdown also to be a link. a tag will not work in summary tag, neither will it expand the content.

So, can you use it? Yes. Should you use it? No. Simply, there are better ways to do it.