title: Combine CSS Attribute and Pseudo-Element Selectors?
body: <p>How can I combine a pseudo-element selector (<code>:after</code>) with an attribute selector (<code>[title]</code>)?</p>
  
  <p>I tried using <code>div[title]:after</code>, but this doesn't work in Chrome.</p>
  
  <p>HTML:</p>
  
  <pre><code>&lt;div title="foo"&gt;This div has a title.&lt;/div&gt;
  &lt;div&gt;This div does not have a title.&lt;/div&gt;
  </code></pre>
  
  <p>CSS:</p>
  
  <pre><code>div:after {
      content: "NO";
  }
  div[title]:after {
      content: "YES";
  }
  </code></pre>
  
  <p>Demo: <a href="http://jsfiddle.net/jmAX6/" rel="noreferrer">http://jsfiddle.net/jmAX6/</a></p>
  
  <p>It shows me "YES" at the end of each of those div's, when it should show "NO" after the second div.</p>
  
  <p>I'm running Chrome 17.0.963.38. It seems to work fine in Safari 5.1.2.</p>