title: How do I select an element that has a certain class?
body: <p>My understanding is that using <code>element.class</code> should allow for a specific element assigned to a class to receive different "styling" than the rest of the class. This is not a question about whether this should be used or not, but rather I'm trying to understand how this selector is intended to work. From looking at a ton of examples on the internet, I believe the syntax is correct and do not understand why this is not working. </p>
  
  <p>Here is an example:</p>
  
  <p>CSS:</p>
  
  <pre><code>h2 {
      color: red;
  }
  
  .myClass {
      color: green;
  }
  
  h2.myClass {
      color: blue;
  }
  </code></pre>
  
  <p>HTML:</p>
  
  <pre><code>&lt;h2&gt;This header should be RED to match the h2 element selector&lt;/h2&gt;
  &lt;div class="myClass"&gt;
      &lt;h1&gt;This header should be GREEN to match the class selector&lt;/h1&gt;
      &lt;h2&gt;This header should be BLUE to match the element.class selector&lt;/h2&gt;
  &lt;/div&gt;
  </code></pre>