Is there a way in 2013 to use CSS to detect and respond to text overflowing an HTML element? I've read about using JavaScript for this, but I'm curious if the CSS spec offers a solution.
For example, having a fixed size div like this:
<div class="smart-warning" style="width:200px; height:20px; overflow:hidden">
This is my very long text that would overflow the box.
</div>
I'd like to apply a style when text overflows, such as:
<style>
.smart-warning {
border:1px solid black
}
.smart-warning:overflowing {
border:1px solid red
}
</style>
It seems like a feature like this could be beneficial and almost within reach with CSS, but diving into specifications isn't really my thing. Do you think it's worth adding if it doesn't exist already?
Thank you!