title: CSS selector: first div within an id or class
body: <p>What is the proper CSS selector to select the first div within a class or with a specific id? This seems to be much easier with parent/child elements but I haven't found anything for simple elements.</p>
  
  <p><strong>Update: solution</strong></p>
  
  <p>The cleanest, most compatible solution I found was .class ~ .class which selects all the latter classes that follow the former class. For example, if you wanted to remove the top border from the first element within its class you would:</p>
  
  <pre><code>&lt;style&gt;
      .dolphin {
          border-top:0;
          }
      .dolphin ~ .dolphin {
          border-top:1px solid #000;
          }
  &lt;/style&gt;
  </code></pre>