DEV Community

loading...

Discussion on: Create Drop-Down Menus with Plain CSS

Collapse
ronca85 profile image
ronca85

i never claimed details should be used AS navigation. but if this element is used IN navigation it works great. it works great when nested, as well. tab around and it's fully accessible. if ie11 is not an issue i see no reason not to adopt this functionality. github uses the details tag where they need a dropdown, for example when switching branches. isn't this a good enough proof that it works?

Thread Thread
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.