Qaisa Qaisa - 4 months ago 6
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

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;
     } }