最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

css - How to fix shifting header after installing speedcache plugins?

matteradmin9PV0评论

After installing (and uninstalling) Autoptimize, Async JavaScript, BJ Lazy Load, and Leverage Browser Caching plugins, my header shifts back and forth on page load - can you help find the fix?

I am pretty good with CSS but can't find the culprit of the fix. If you click the link you will most likely (haven't tested this bug in all devices and screen sizes - i see it in Chrome on Mac) see the upper left logo and menu items shift back and forth about a pixel.

I was working on page speed and one of those plugins did this. After deleting all four of those, it still is doing it. (The link below they are still activated, but i tested with another staging site deleting them and it didn't change.)

Can you help me come up with a CSS fix? I use Dev tools console every day - is there a way to "Freeze" or stop the page load at the exact moment this shifts, so i can inspect the CSS and compare to when page is loaded - maybe similar to how you can use breakpoints in JavaScript?

Needless to say lesson learned about making backups and / or using staging site to test plugins like those. Or in this case a staging staging site!

Thanks!

After installing (and uninstalling) Autoptimize, Async JavaScript, BJ Lazy Load, and Leverage Browser Caching plugins, my header shifts back and forth on page load - can you help find the fix?

I am pretty good with CSS but can't find the culprit of the fix. If you click the link you will most likely (haven't tested this bug in all devices and screen sizes - i see it in Chrome on Mac) see the upper left logo and menu items shift back and forth about a pixel.

I was working on page speed and one of those plugins did this. After deleting all four of those, it still is doing it. (The link below they are still activated, but i tested with another staging site deleting them and it didn't change.)

Can you help me come up with a CSS fix? I use Dev tools console every day - is there a way to "Freeze" or stop the page load at the exact moment this shifts, so i can inspect the CSS and compare to when page is loaded - maybe similar to how you can use breakpoints in JavaScript?

Needless to say lesson learned about making backups and / or using staging site to test plugins like those. Or in this case a staging staging site!

Thanks!

http://04a.b95.myftpupload

Share Improve this question asked Apr 2, 2019 at 14:51 Ben BlueBen Blue 1171 silver badge8 bronze badges 6
  • Do you still have same css files loaded? Are you sure there are no additional .css loading? – Roland Commented Apr 2, 2019 at 20:25
  • Yes it is the same - my working theory is Autoptimize changed some CSS. What i just found, was this CSS rule which i changed to be padding: 0px and problem solved: @media only screen and (min-width: 800px) { .no-overflow-y body { padding-right: 9px !important; } } I don't completely understand what happened, but that seems to have fixed it. – Ben Blue Commented Apr 2, 2019 at 20:31
  • so, all good? :) – Roland Commented Apr 2, 2019 at 20:42
  • yea looks like it. What's the right thing to do to my question here? – Ben Blue Commented Apr 2, 2019 at 20:43
  • I guess you should do the 'Answer your own question', or something like that, thingy – Roland Commented Apr 2, 2019 at 20:46
 |  Show 1 more comment

1 Answer 1

Reset to default 0

i found this CSS: @media only screen and (min-width: 800px) { .no-overflow-y body { padding-right: 9px !important; } }

and changed it to @media only screen and (min-width: 800px) { .no-overflow-y body { padding-right: 0px !important; } }

and that solved the issue.

Post a comment

comment list (0)

  1. No comments so far