HTML page loads different first and second time (Google Chrome)

前端 未结 2 446
情深已故
情深已故 2021-01-18 12:35

I have an HTML page that loads one way the first time you load it and another way the second time. This is reproducible using Chrome in private mode (because it clears the c

2条回答
  •  礼貌的吻别
    2021-01-18 12:57

    Ok - the issue depends on multiple things

    • only might happen with an empty cache
    • depends on the loading speed of font-awesome & bootsrap - if they load faster than your logo or not...

    So while running Chrome in Incognito Mode and reloading again and again eventually I could reproduce the issue.

    You cannot easily fix the loading race condition but fixing your css should work :

    1. add class pull-left to your logo
    2. clear the floated area by applying class clearfix to the page-header
    3. Its not necessary but good choice, add width & height to your logo image so it doesn't pop in once loaded

    So here it is:

    Hope that helped.

提交回复
热议问题