title: div.classname in css file
body: <p>I have seen some developers write </p>
  
  <p><strong>HTML:</strong></p>
  
  <pre><code>&lt;div class="test"&gt; some content &lt;/div&gt;
  </code></pre>
  
  <p><strong>CSS:</strong></p>
  
  <pre><code>div.test {
    width:100px.
  }
  </code></pre>
  
  <p>What is the purpose of doing <code>div.className</code> instead of just <code>.className</code>.</p>
  
  <p>Does this mean this style will be applied only when the class is applied to a div.</p>
  
  <p>So, <code>&lt;span class='test'&gt;content&lt;/span&gt;</code> will have no effect of 'test' with the css above?  If that is the case, is that best practice? This is almost like style overriding for different type of elements, mixing styles with rules!</p>