title: Pure CSS clickable dropdown?
body: <p><a href="https://www.w3schools.com/css/css_dropdowns.asp" rel="noreferrer">This tutorial</a> explains how to use the <code>:hover</code> pseudo-class to style HTML elements on hover and how to how create a dropdown when hovering over a particular element in pure CSS (without using any JavaScript).</p>
  <p>Is it possible to create the same dropdown as the one in the example below, in pure CSS, but when clicking an element instead of when hovering over it?</p>
  <p>I would prefer to use no JavaScript at all, or - if not possible without JavaScript - as little JavaScript as possible. The items of the drowndown should be clickable themselves.</p>
  <h3>Example:</h3>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="false" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-css lang-css prettyprint-override"><code>.dropdown {
      position: relative;
      display: inline-block;
  }
  
  .dropbtn {
      background-color: #4CAF50;
      color: white;
      padding: 16px;
      font-size: 16px;
      border: none;
      cursor: pointer;
  }
  
  .dropdown-content {
      display: none;
      position: absolute;
      right: 0;
      background-color: #f9f9f9;
      min-width: 160px;
      box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
      z-index: 1;
  }
  
  .dropdown-content a {
      color: black;
      padding: 12px 16px;
      text-decoration: none;
      display: block;
  }
  
  .dropdown-content a:hover {background-color: #f1f1f1}
  
  .dropdown:hover .dropdown-content {
      display: block;
  }
  
  .dropdown:hover .dropbtn {
      background-color: #3e8e41;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="dropdown" style="float:left;"&gt;
    &lt;button class="dropbtn"&gt;Left&lt;/button&gt;
    &lt;div class="dropdown-content" style="left:0;"&gt;
      &lt;a href="#"&gt;Link 1&lt;/a&gt;
      &lt;a href="#"&gt;Link 2&lt;/a&gt;
      &lt;a href="#"&gt;Link 3&lt;/a&gt;
    &lt;/div&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>