CLS issues on divs and sections

Hey guys, I have just build this website and when I’m looking in pagespeed.dev there is quite a big CLS on desktop, and it’s also visible when you are navigating the website.

Why I’m asking here is because it’s been build in bricks of course but the CLS is on div, not images or anything else, see image:

Here is the link in case you’d like to test it yourself: https://www.taxreliefhelpers.com/

I don’t fully understand it, why I div would have such big CLS.

Is there anything I can do about it?

Thanks

Hi

Web page speed scores are one thing.

But page responsiveness in the real world is another thing, in my opinion.

Your page loads instantly on my device here, I wouldn’t know where / why it should load any faster.

Cheers

Patric

Hi Patric,

Thanks for your reply.

I know the speed is good, and I’m not much concerned about that, but the CLS is bugging me a little. Not sure whether that bricks fault or mine when building and setting up the website or any other fault.

Would like to understand it to avoid it next time.

It’s because most of the page CSS is being added at the very bottom of the page instead of inside of the head where it should be. This means the HTML is visible for a split second, with a lot of styling missing (known as FOUC). I can see it when I visit the page with browser cache disabled.

Attaching a screenshot to show what I see when the page first loads, and where the CSS is for a lot of the default Bricks styles…

SCR-20230412-quxl

3 Likes

Ok, thanks!

And is there anything I can do to load it before?

Probably identify the CSS file and preload it with perfmatters?

Could this be a solution?

Thanks

it’s in the head by default, so it must be the performance plugin setting minifying it and deciding to put it in the footer. (probably to trick the page scores in thinking less CSS is being loaded, but causes this type of issue)

I’ve taken the screenshots before activating the caching plugin and perfmatters.

Always trying to do any tests before activating any performance plugins, that’s why the CLS is bugging me because it’s there by default.

the URL for the css at the bottom is…

../wp-content/cache/www.taxreliefhelpers.com/wpfc-minified/79xqr353/4kuyg.css

Whatever ‘wpfc’ stands for, is the cause of the minifying and putting it in the footer.

edit - could be the wp fastest cache plugin?

That may have been during your testing. I have disabled wp Fastes cache and perfmatters.

Now it’s only bricks, but the CLS is still there.

I keep it disabled in case you want to have a look again.

It’s really like wplit says a problem with a performance plugin.

I have the same problems with the CLS value in desktop view with WPRocket.
Mobile I get always 100%
When I deactivate WP-Rocket, I get 100% in the desktop view. But then the mobile value drops.

I haven’t had time to test the individual settings yet, but maybe it really is the setting for “minifying CSS”.

I didn’t have performance plugin installed when taken the image, and currently they are all disabled.

It’s definitely not any performance plugin. Maybe a setting or my development fault, not sure. But would be great if I could figure it out.

looking at it again, if you look at the screenshot i gave, the main thing that is missing when the page first loads is the form.

And the section height, and all the sections below it that are coming up on your pagespeed report would be affected by that form going from 0 height to whatever height it eventually is when it loads. It all moves as the form changes height.

Try adding a min-height on the form, or a div around it so that the height is the same before the form loads as it is after it has loaded.

wplit Thanks! :slight_smile:

This has sorted the problem! I’m in green numbers again.

I understand what CLS stands for, but haven’t thought this could happen.
Now I have learnt something new and will apply it for the next projects too.

Really appreciate taking your time to explain it, guys!