DEV Community

cmfdev
cmfdev

Posted on

Simple, Easy HTML Dropdown

Make a simple dropdown menu with bare HTML!
Use the following code:

<details>
<summary>This text will always be visible</summary>
This text is hidden until the dropdown is clicked
</details>
Enter fullscreen mode Exit fullscreen mode

Top comments (2)

Collapse
 
cmuralisree profile image
Chittoji Murali Sree Krishna

You can embed the codepen in here

{% codepen https://codepen.io/CMFdev/pen/oNBzZJY %}
Enter fullscreen mode Exit fullscreen mode

Then you can show it like this:

Collapse
 
cmfdev profile image
cmfdev • Edited

I did not know that! I'll get it done.