Qaisa Qaisa - 1 year ago 85
Javascript Question

Using CSS3 font-stretch instead of wrapping

I have a div with a text that overflows when viewed from a phone. Is it possible to detect that the text is overflowing and change the font-stretch property automatically?

Answer Source

I could not detect wrapping, and ended up using a @media rule to condense the text:

 @media screen and (max-width: 800px) {
     body {
        font-stretch: condensed;
     } }