PH Ranking - Online Knowledge Base - 2025-09-04

Preloading Fonts and Managing Web Fonts to Minimize Layout Shifts

To minimize layout shifts caused by web fonts and improve loading performance, preloading fonts and managing font loading strategies effectively are key.

Best practices for preloading fonts:

  • Preload only critical fonts needed for the initial above-the-fold content to avoid unnecessary network competition and delays. For example, preload the main body or heading font but not every style or weight like italics or bold.
  • Preload only modern font formats such as .woff2 to reduce file size and improve load speed, avoiding older formats like .woff or .ttf.
  • Use a proper <link rel="preload" as="font" crossorigin="anonymous"> tag in the HTML head to fetch fonts early, making font requests parallel to CSS and reducing render-blocking.

Managing font-display to prevent layout shifts:

  • Use the CSS font-display property in @font-face declarations to control how fonts load and fallback fonts behave. The font-display: optional value is effective in preventing layout shifts by allowing the browser to use a fallback font if the web font is not loaded quickly, avoiding invisible or shifting text.
  • Other font-display options include:
    • block: hides text up to 3 seconds waiting for the font (can cause layout shifts).
    • swap: shows fallback immediately and swaps to web font when loaded.
    • fallback: hides text briefly then swaps if font loads soon.
    • optional: hides text very briefly and only uses web font if available immediately, never swapping later.

Additional recommendations:

  • Combine font preloading with font-display to balance user experience and performance.
  • Avoid preloading too many fonts or multiple styles to prevent bandwidth bottlenecks and delays.
  • Ensure font URLs used in preload tags exactly match those suggested by performance tools like PageSpeed Insights and that fonts are hosted on your domain or CDN to avoid conflicts.

By carefully preloading only essential fonts and using font-display: optional or similar strategies, you can significantly reduce layout shifts caused by web fonts and improve your site's Core Web Vitals and user experience.

Internet images

Ang PH Ranking ay nag-aalok ng pinakamataas na kalidad ng mga serbisyo sa website traffic sa Pilipinas. Nagbibigay kami ng iba’t ibang uri ng serbisyo sa trapiko para sa aming mga kliyente, kabilang ang website traffic, desktop traffic, mobile traffic, Google traffic, search traffic, eCommerce traffic, YouTube traffic, at TikTok traffic. Ang aming website ay may 100% kasiyahan ng customer, kaya maaari kang bumili ng malaking dami ng SEO traffic online nang may kumpiyansa. Sa halagang 720 PHP bawat buwan, maaari mong agad pataasin ang trapiko sa website, pagandahin ang SEO performance, at pataasin ang iyong mga benta!

Nahihirapan bang pumili ng traffic package? Makipag-ugnayan sa amin, at tutulungan ka ng aming staff.

Libreng Konsultasyon

Free consultation Customer support

Need help choosing a plan? Please fill out the form on the right and we will get back to you!

Fill the
form