How do i avoid a flash of unstyled content (FOUC) on Google Sites

501 Views Asked by At

I have placed some custom HTML, CSS, and jQuery inside an HTML box in my google site. but as the page loads, the unformatted content shows for several seconds until the loading is complete. attempts to add the following:

html { visibility: hidden; }

and then turning it back on later in jQuery do not appear to work inside a Google site.

Does anyone have another suggestion?

1

There are 1 best solutions below

0
On

I don't know if this works on a google site or not, but using <body style='display:none;'> and then in the jQuery document ready function place $("body").show(); has worked for me.

For some reason using style on the body statement works faster than the CSS file even if the CSS file appears in the head section.