Which class will be applied to div and why? : <p>I came across a interesting code. If we run the below code snippet, green class will be applied for both the divs. Can anyone explain why?      </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>.orange {
    color: orange;
}
.green {
    color: green;
}</code></pre>
<pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="orange green"&gt;Div 1&lt;/div&gt;
&lt;div class="green orange"&gt;Div 2&lt;/div&gt;   </code></pre>
</div>
</div>
</p>
