Only apply CSS where text overflows?

172 Views Asked by At

Is it possible to apply CSS to an element only when the text overflows?

For example, I'm using text-overflow: ellipsis; to truncate a long line and would like to (for example) colour the div red when text has overflown

As this is a userstyle (Stylish, to be exact) it has to be achievable in CSS

(and for those wondering, I'm actually trying to get the text to marquee on hover. It works so far, but also marquees even if the text hasn't overflown)

0

There are 0 best solutions below