Site logo

Archived topic

Cls issue

17 replies · Started by vaibhav on June 19, 2021

Viewing posts 1–15 of 18

I am getting cls issues. These two issues,

<div class="site grid-container container hfeed">

<div class="inside-navigation grid-container">

Hi there,

those are just the elements that are being affected by the CLS - they are simply HTML so are NOT the cause of the CLS.
Can you share a link to a post where you're seeing a high CLS

The issue looks related to the lazy loading of images - the placeholders being loaded before the image are larger then the actual image. Can you temporarily disable lazy loading to see if that resolves the issue. If it does then you may want to check with the lazy loader plugin author regarding the issue.

Let me know

Yes, now I disabled all lazy loading plugin and actually it work fine desktop totally. For mobile it also shows average results.
Mobile cls showing 0.166 and desktop cls shows 0.074.
so for mobile can we have more option to correct it. You check from your side

The other CLS is coming from the Advert that is being inserted above the main content.
Looking at the HTML the advert is in a Container that starts with:

<div class="code-block code-block-6" style="margin: 8px 0; clear: both;">

Can you edit that ? If so add another CSS Class of advert-height so it looks like this:

<div class="code-block code-block-6 advert-height" style="margin: 8px 0; clear: both;">

Then you can give the element a min-height with this CSS:

.advert-height {
    min-height: 157px;
}

Should i add this code to css,
`.advert-height {
min-height: 157px;
}

Then look for cls results

Thats correct - after you have made those changes to the HTML

can you explain little bit how and where i can get this html code? So i can change it.

How are you adding the adverts to your site ?

I just copy the code add it to adverts plugin

K i found that code in advert plugin. But changing code details will harm AdSense?

I don't believe so.

I can see this code in plugin but disable insertion is showing and cant change this code

Then you might need to check with the support team of AdSense to see if their code can be improved to eliminate the issue.

This archived topic is closed to new replies.