title: Why ID has stronger meaning than Class in CSS styling even if declared before the Class
body: <p>If I declare in my css file(or inside <code>&lt;style&gt; &lt;/style&gt;</code> tags) firstly the <code>id</code> of element and then the <code>classname</code> of the same element, then the <code>id</code> styling will be applied, regardless the fact that <code>classname</code> is the latest one in order.</p>
  
  <p>I want to know <strong>why</strong> this is happening and if it has some naming, please do tell.</p>
  
  <p>Just to make it more clear, take a look at this example, please:</p>
  
  <pre><code>div {
    height:100px;
    width:150px;
    border:1px solid #000;
    margin:0 auto;
  }
  #theID {
    background:#090;
  }
  .theCLASS {
    background:#00F;
  }
  
  
  
  &lt;div id="theID" class="theCLASS"&gt;&lt;/div&gt;
  </code></pre>