Solving CLS Caused by Web Fonts
Web fonts can cause layout shifts as fallback fonts are replaced by downloaded web fonts. To mitigate this:
- Use a font fallback similar in size and spacing to the final web font.
- Preload web fonts to minimize delays:
html
<link rel="preload" href="/some-font.woff2" as="font" crossorigin="anonymous">
Solving CLS Caused by Icons
Icon fonts (e.g., Font Awesome) can cause layout shifts if the font file is not loaded in time. Reserve space for icons using CSS:
cssnav .searchicon {
width: 64px;
height: 64px;
}
Solving CLS Caused by AJAX
AJAX content updates can lead to layout shifts if no space is reserved for new content. Estimate the height of the AJAX content and reserve space in advance:
css#ajax { height: 400px; }
#ajax.loaded { height: auto; }
Solving CLS Caused by Ads
Ads that load late in the page often contribute to layout shifts. Reserve space for ads in the visible viewport:
css.ad { min-height: 250px; background: #dedede; }
@media only screen and (min-width: 600px) {
.ad { min-height: 90px; }
}
Optimizing Core Web Vitals with Tuurbo
Optimizing Core Web Vitals, including CLS, can be a complex process requiring advanced technical skills. The difficulty varies depending on your site’s structure and technologies used.
To simplify this process, we developed Tuurbo, a tool designed to automatically address these challenges. With Tuurbo, you can improve your CLS and other Core Web Vitals metrics within 48 hours - no extensive development sessions or costly consultations needed.
Explore our guides and discover how Tuurbo can help you achieve a faster, more user-friendly website.
Does it seem like magic?
You don't believe it, do you?! Try it!
Try our solution, enjoy the results, and decide how long to keep your subscription active.