<div class="dropdown">
        <svg height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
          <path d="M0 3h20v2H0V3zm0 6h20v2H0V9zm0 6h20v2H0v-2z" fill="white"/>
      <div class="dropdown-content">
          <li>Sign out</li>

  Other content below the navigation bar
nav {
  padding: 1.2em;
  background-color: #8259a8;
  color: white;

.dropdown {
  display: inline-block;
  position: relative;

/* Hiding The disclosure widget */
.dropdown summary {
  list-style: none;
  cursor: pointer;

.dropdown summary::-webkit-details-marker {
  display: none; 

/* Detaching details content */
.dropdown .dropdown-content {
  position: absolute;
  min-inline-size: max-content;
  background-color: white;

.dropdown ul {
  list-style: none;
  margin: 0;
  padding: 1em;
  border: 1px solid #8259a8;
  background-color: white;
  color: #8259a8;

/* Closing the detail content on clicking anywhere else */
.dropdown details[open] summary::before {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  content: "";
  cursor: default;
  background-color: rgba(255, 0, 0, 0.2);

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.