0

I'm currently working on building a website with React. I use Node and express along with React Router.

I have set a background image on the page but when the site first loads, the website displays and then the image displays.

What do I need to change to get the website to wait to display until all assets are loaded?

I've tried to shrink the size of the image, convert to .webp from .jpg and .png but no luck.

  • Hide the main content with `display:none` and then use the `onload` event to change the main content to `display:block`. If you're using `background-image` then check this answer: https://stackoverflow.com/a/22788887/1645045 – Andrew Lim Mar 07 '23 at 18:08

0 Answers0