Search code examples
cssinternet-explorerbrowsermedia-queries

Target IE's text size with media queries or js


Is there a way to target changes selected by the user in IE's View > Text Size using media queries or similar?

So, for example, when the user changes the text size to "large" I can call something like @media (text-size: large) and apply specific styles. Could also do with any js solutions.


Solution

  • You could use JavaScript to build an in-memory element with font-size:medium and compare its width to a control element with a known font size.

    You can use this information to add a class (small, large, etc.) to which you can use in your CSS.