Skip to main content

  • Member Sign In
  • Become A Member
  • Need Support?
  • English

    Select Your Language

    Fonts.com is currently in English

    • English
    • Deutsch
    • 日本語
    Close
  • USD
  • Items In Your Cart:0

fonts.com

  • Browse Fonts
  • Web Fonts
  • Subscriptions
  • Learn About Fonts & Typography

  • Home
  • Support
  • Fonts.com FAQs
  • Why is my DOM now being littered with mti_font_element classes?
  • Shopping on Fonts.com
  • Using and Installing Desktop Fonts
  • About Fonts.com Web Fonts
  • Fonts.com Web Fonts Accounts
  • Fonts.com Web Fonts Billing
  • Using Fonts.com Web Fonts
  • Troubleshooting Issues with Web Fonts
  • SkyFonts
  • Subscription Desktop and Mockup Fonts
  • Typecast

 

 

 

Why is my DOM now being littered with mti_font_element classes?

Our method of preventing FOUT (flash of unstyled text) is optimized; we use a single class to hide only the text for elements using Web fonts. We then strip that class’s properties when the Web fonts are ready to display. One thing to note is that the class is left on these elements in the DOM; however, without properties the class has no meaning and is invisible to visitors, save for those using some manner of developer tools.

If you’d like, you can add an additional configuration variable that will tell our script to remove class once it’s no longer necessary:

<script type="text/javascript">
    // first, create the object that contains
    // configuration variables
    MTIConfig = {};

    // next, add a variable that will control
    // whether or not FOUT will be prevented
    MTIConfig.EnableFOUT = true // true = prevent FOUT

    // finally, add a variable that controls
    // whether or not to leave the mti_font_element class in the DOM
    MTIConfig.RemoveMTIClass = true; // true = remove when finished
</script>

Please note that removing the class is disabled by default; the removal requires a fair amount of overhead for the script to successfully ensure that all elements no longer have the class assigned.

Find Your Type

  • About
  • Blog
  • Services
  • Submit Fonts
  • Be an Affiliate
  • Support
  • Contact
  • Developers
  • Monotype
  • Legal
  • Sitemap
  • Font Index
  • Facebook
  • Twitter
  • 1.1605.13.1520