title: How to add gradient background to a drop-down select option?
body: <p>I am wondering if it is possible to add style to an select option, that is shown as a drop-down, specially in the <code>::before</code> part. If I use the select as a list (with <code>size="5"</code>) works well. So, I think that with dropdown the <code>::before</code> element does not work:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-css lang-css prettyprint-override"><code>#list {
    width: 200px;
    height: 100px;
  }
  
  #dropdown {
    width: 200px;
  }
  
  .gradient {
    position: relative;
    overflow: hidden;                   
  }
  
  .gradient:before {
    content: "";
    position: absolute;
    width: 900px;
    height: 300px;
    top: -50%;
    left: -125%;
    background-image: linear-gradient(#5cb85c, transparent);
    transform: rotate(90deg);
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;html&gt;
    &lt;body&gt;
      &lt;select id="dropdown"&gt;
        &lt;option value="one" class="gradient"&gt;One&lt;/option&gt;    
        &lt;option value="two"&gt;Two&lt;/option&gt;    
        &lt;option value="three" class="gradient"&gt;Three&lt;/option&gt;    
        &lt;option value="four"&gt;Four&lt;/option&gt;    
      &lt;/select&gt;
      
      &lt;br/&gt;&lt;br/&gt;
      
      &lt;select id="list" size="5"&gt;
        &lt;option value="one" class="gradient"&gt;One&lt;/option&gt;    
        &lt;option value="two"&gt;Two&lt;/option&gt;    
        &lt;option value="three" class="gradient"&gt;Three&lt;/option&gt;    
        &lt;option value="four"&gt;Four&lt;/option&gt;    
      &lt;/select&gt;    
    &lt;/body&gt;
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p><a href="https://i.stack.imgur.com/8oO0n.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8oO0n.png" alt="selects"></a></p>
  
  <p>Is it possible? If not I will use a flat background color</p>