Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Browser flashes white when resizing window using css media queries in Chrome

When resizing the browser window in Chrome, I'm getting a white flash when using a single CSS media query declaration. If I remove the media query, the problem goes away. Has anyone experienced this issue? Is there a workaround?

My media query:

@media screen and (min-width: 1200px) {

    /* Styles go here */

}
like image 660
onestepcreative Avatar asked Sep 16 '25 12:09

onestepcreative


1 Answers

After a bit of research and chatting with a couple other people, we were able to find a fix for this webkit bug. To fix the white flash, I was able to use these CSS declarations:

-webkit-transform: translateZ(0);
-webkit-perspective: 1000;

I've also been told that this may also get around the webkit bug:

-webkit-backface-visibility: hidden;

I applied these declarations to the body tag, but it may work differently for you, depending on your website.

like image 80
onestepcreative Avatar answered Sep 18 '25 10:09

onestepcreative