title: CSS Last Odd Child?
body: <p>I have an unordered list, which can contain either an even or odd number of items. I'm looking for a CSS-only way to remove the border from the last 2 <code>li</code> tags if the number of <code>li</code>s is even. The <code>:last-child</code> pseudo-selector removes the last one regardless. </p>
  
  <pre><code>li {
  float: left;
  border-bottom: 1px solid #000;
  }
  
  li:last-child{
  border-bottom: none;
  }
  </code></pre>
  
  <h3>Works for Odd Numbers of <code>li</code>s</h3>
  
  <pre><code>+============================================+
  +          1          |          2           +
  +--------------------------------------------+
  +          3          |                      +
  +============================================+
  </code></pre>
  
  <h3>But for even numbers, I need to remove the bottom of cell #3</h3>
  
  <pre><code>+============================================+
  +          1          |          2           +
  +--------------------------------------------+
  +          3          |          4           +
  +---------------------                       +
  +============================================+
  </code></pre>
  
  <p>So I figured I could use <code>li:nth-last-child()</code> but I can't figure out what should be the equation to grab the last odd child. </p>
  
  <p>It's not <code>2n+1</code>, <code>2n-1</code>, <code>n-1</code>, or anything I can think of. Please help. </p>