Site logo

Archived topic

menu item height - changes mobile header height

29 replies · Started by Stephen on March 13, 2022

Viewing posts 16–30 of 30

Hi Stephen,

Have you tried the CSS with new media query?

Does it work?

Hi Ying, thats the same media query as originally used.

@media(min-width: 769px)

- I'm assuming that means it applies to all screen sizes above 769px which is tablet and desktop ?

Possibly it should be max width to apply to mobile phone screen size which is where I get the woo CLS?

@media(max-width: 769px)

Thanks
Stephen

Hi, sorry about that I didnt notice it was now outside the media query brackets.

I've used the new CSS and unfortunately the shift is remaining 0.267 for https://www.slservice.net/product-page/clipper-blade-sharpening/

I cant see anything actually shifting in the screen shots in chrome developer tools but it is recorded in the page score.

Thanks
Stephen

This CSS rule:

.woocommerce div.product .woocommerce-product-gallery  {
    min-height: 354px;
}

Increase the min-height to 454px - it may need tweaking - if that don't work then Woos just being a pain as usual

Well thats it - 0 CLS on all products !!

I've never seen that before with Woocommerce products - Google Search Console can stop marking most of my sites URLs as Failing ones.

Thank you for taking the time to work that out.

I'm thinking that one day woocommerce will properly fix the error and then I should then remove that bit of CSS.

The mobile CLS is now always zero

- but I just checked woocommerce desktop product pages and I do have CLS on these from 0.14 to 0.45.

This looks like a totally different cause and maybe comes from the add to basket button re sizing as the page loads ?

Thanks
Stephen

Hmmm... that could be the late loading of the add to cart form.
Try adding this CSS:

.woocommerce-variation-add-to-cart {
    min-height: 76px;
}

Hi, not making any difference so far.

I'll look into this more to see if I can work out what exactly is shifting.

Thanks
Stephen

The Add to Cart form is loading different options - now i see the Apple Pay option on the form, which is loading late. You will need to address that Woocommerce i am afraid

Hi OK thanks, that does make sense, I've noticed woocommerce loads apple pay and google pay buttons on some pages.

Much appreciated
Stephen

Yeah - it wouldn't be so bad if they were displayed consistently and the various options had a a consistent height. Then you could treat it with CSS - but in their absence there's going to be a big gap.

Hi, well I suppose a little bit of shift is only really a problem when Google are marking you down for it.

There is some sites with advertising that shift about so much they are almost unusable.

But best to try and keep Google happy if possible.

Thanks
Stephen

This archived topic is closed to new replies.