How to prevent the white 'flash' on page load created by background image loading delay?

后端 未结 6 1893
不知归路
不知归路 2020-12-23 09:35

The problem is, on most sites on the web, there are background images. They take time to load. Ordinarily, it wouldn\'t be a problem if the images were optimized, and small

6条回答
  •  北海茫月
    2020-12-23 10:41

    You may use something like this:

    HTML

    
    
    

    CSS

    /* Hide slider image until page is fully loaded*/
    body:not(.loaded) #slider img {
      display:none;
    }
    

提交回复
热议问题