title: CSS-only detection of text overflows in HTML?
body: <p>I've seen suggestions on using JavaScript for detecting and acting on text that overflows an HTML element.  But it's 2013, so I was wondering if maybe the CSS spec had a way to detect overflows itself.</p>
  
  <p>In other words if I have a fixed size div:</p>
  
  <pre><code>&lt;div class="smart-warning" style="width:200px; height:20px; overflow:hidden"&gt;
  This is my very long text that would overflow the box.
  &lt;/div&gt;
  </code></pre>
  
  <p>I'd like to have a style that would do something if the text overflowed such as:</p>
  
  <pre><code>&lt;style&gt;
  .smart-warning {
    border:1px solid black
  }
  .smart-warning:overflowing {
    border:1px solid red
  }
  &lt;/style&gt;
  </code></pre>
  
  <p>It seems like we'd be really close to having something like this in CSS but pouring over the specifications is not my game.</p>
  
  <p>If it doesn't exist, do you think it would be useful?</p>
  
  <p>Thanks!</p>