title: Change background color of jQuery autocomplete item based on state (using CSS)
body: <p>The goal is to create a JQuery autocomplete element whose list items have a blue background when they're hovered over or focused via the keyboard. The Facebook search box pulls this off nicely.</p>
  
  <p>Each <code>&lt;li&gt;</code> element contains custom HTML wrapped in an <code>&lt;a&gt;</code>. Each of those <code>&lt;a&gt;</code> tags belongs to the class <code>sbiAnchor</code>. Generating the blue background on hover can be done successfully using the following CSS:</p>
  
  <pre><code>.ui-autocomplete a.ui-corner-all.sbiAnchor:hover{
      background: blue;
  }
  </code></pre>
  
  <p>But how does one apply that same blue background when the user keys up/down the autocomplete list. Changing the CSS code to the following does NOT work:</p>
  
  <pre><code>.ui-autocomplete a.ui-corner-all.sbiAnchor:hover, .ui-autocomplete .ui-state-focus a.ui-corner-all.sbiAnchor{
      background: blue;
  }
  </code></pre>
  
  <p>What's the correct approach here? Keep in mind that this blue background effect should only apply to one specific autocomplete on my page (several of them exist). That's why I'm using sbiAnchor to differentiate its items from those of the other autocomplete elements. The other autocompletes should retain their default behavior so the CSS selectors shouldn't be too broad.</p>