Archived topic
CLS
9 replies · Started by Nicole on February 27, 2022
I am trying to get rid of my CLS shift but nothing seems to solve the problem. It looks like all the issues are related to the navigation menu. I made it open on click only (even though I would prefer hover) but it didn't help. These are the things that still seem to be causing a shift:
<header class="site-header grid-container has-inline-mobile-toggle" id="masthead" aria-label="Site" itemtype="https://schema.org/WPHeader" itemscope="">
0.39
<ul class="sub-menu">
0.26
<ul class="sub-menu">
0.03
Any help will be much appreciated.
Hi Nicole,
I tried testing your website on 3 different platforms.
GTmetrix: https://share.getcloudapp.com/RBuygAJD
Lighthouse: https://share.getcloudapp.com/6quEjoJD
PageSpeed Insights: https://share.getcloudapp.com/WnuqQ8p4
As shown, I couldn’t seem to replicate the issue on multiple tests. It seems that the CLS issue no longer exists. With that said, may I know if you’ve already resolved this?
Hope to hear from you soon. :)
Thank you for checking that out. I checked again and the mobile doesn't have a CLS issue but the desktop still does.
I added a link to the page that I am working on where the CLS issue seems to be more of an issue which is strange since the navigation should affect all pages equally.
No problem Nicole! I can see the CLS in the link you sent. It appears that the cause of the CLS/movement of the elements specified in the tests are the advertisements.
Specifically, once they load, they push the specified elements in GTmetrix out of place.
This isn’t a theme related issue but here are some tips I found which could assist you regarding this:
Hope this helps! :)
Thanks so much!
You’re welcome Nicole! Glad to be of assistance! Feel free to reach out anytime if you’ll need assistance with anything else. :)
It is possible to make the section on the top a set height (higher than the ad) and then the ad won't make a difference?
I am referring to the banner on the top of the navigation bar. If that section is 100 pixels high no matter what ad is there then I assume that that will solve the problem. That is what I had in my previous theme but I don't know how to do it with Generatepress.
Hi there,
you can try adding some CSS:
#AdThrive_Header_1_desktop {
min-height: 90px;
}
Thanks very much!
You're welcome