Pure HTML Dropdown Details Summary Tag

HTML provides a native dropdown of sorts. The intent is to provide more information for a summary line. It can be styled in a number of ways to present a dropdown menu or just additional info about a topic. The details/summary tags together are a little more user friendly than using a title tag to show additional information.

Add style="cursor: pointer;" so the users know something happens when clicked. Otherwise this is a pure html-only dropdown.

Method 1 (HTML only)

<details style="cursor: pointer;">
        <!-- the summary line goes here -->
    <!-- the additional details go here -->

<!-- or "additional details can bo above the summary, see below -->

<details style="cursor: pointer;">
    <!-- additional details can also go above the summary, it works exactly the same in either place -->
        <!-- the summary line goes here -->

Example 1:

The details / summary tag can provide additional details about a topic, or it can be used to create a dropdown menu, or additional info with links.HTML only dropdown menu. Click to see example ...


Method 2 (class it up with some style)

The look of the above example isn't that pretty. It's pure html with no styling. However see below, with style added it can resemble a menu icon (hamburger menu) with dropdown behavior, using the details tag behavior.

This css uses the html <details><Summary></Summary></details> tag along with CSS to create an HTML only dropdown menu. 

The CSS only changes the look of the tag from the arrow, to the menu icon.


/* this is the hamburger menu which
replaces the default arrow; the summary tag
is hidden using display:none */

summary { 
    cursor: pointer;
    display: inline-block;
    border-bottom: 10.5px double black;
    border-top: 3.5px solid black;
    height: 4px;
    width: 25px;

/* this hides the default arrow */

details summary::-webkit-details-marker {

#main a{
    display: block;


<details id="main">
    <a href="javascript:;">Dropdown 1</a>
    <a href="javascript:;">Dropdown 2</a>
    <a href="javascript:;">Dropdown 3</a>

Example 2 - styled like a traditional dropdown menu

Dropdown 1 Dropdown 2 Dropdown 3

Content below the details summary tags are pushed down. The style creates the Hamburger Menu Icon. The dropdown behavior is from the html details tag.

Copyright © Lage.us Website Development | Disclaimer | Privacy Policy | Terms of Use