-1

Loading without CSS

Our website seems to initially load without the appropriate CSS styling. It will take a few seconds before the fully stylized website appears. Are there any common reasons for this to occur? We've reinstalled our overarching theme packs from phpBB, and we've cleared the website cache a few many times. I'm not sure if anyone agress, but there's just something about the website initially loading 'barebones' that seems unprofessional.

Thank you for all the help!

Martijn
  • 15,791
  • 4
  • 36
  • 68

1 Answers1

0

It may not be possible to do with phpBB, but the best solution for the "flash of unstyled content" is to include the critical path CSS inline, in a <style> block in the head of your web page. These styles will take effect as soon as your page is loaded. That way, your page looks decent while waiting for the other external CSS or Javascript files. There is a Critical Path CSS Generator tool online that tells you what styles are critical.

Also, your CSS should come before Javascript. Scripts block the rest of the page from loading, including the styles.

Tools such as Web Page Test can show you what's slowing down the loading of your page.

As mentioned, one solution is to make your page invisible until all the styles load, but that seems unprofessional too.

Michael McGinnis
  • 999
  • 9
  • 27