Telephone: 0161 672 7407   |   Email: info@digitalrefresh.uk

How to fix Divi flashing unstyled headers and content on page load
Home » CSS & Code Snippets » How to fix Divi flashing unstyled headers and content on page load

You’ve spent weeks if not months getting your new website ready for launch and you’ve started to notice that each time a page loads you are briefly seeing it unstyled before before returning to how it should be.

This is called Flash of Unstyled Content and it will display the browser’s default styling briefly before your stylesheets are loaded. This doesn’t look very professional and may be very annoying for both yourself and the user.

To stop this happening, we add a few lines of code.

Adding the Code Snippet

Place the below CSS snippet into your child themes Style Sheet or if you are not using a child theme then you can go to Divi > Theme Options > Integration > Add code to the < head > of your blog

Place the following code snippet.

<script type="text/javascript">
var elm=document.getElementsByTagName("html")[0];
elm.style.display="none";
document.addEventListener("DOMContentLoaded",function(event) {elm.style.display="block"; });
</script>

Adding in this code snippet should instantly fix any problems you are having. Note you may need to clear your website and browser cache to notice the changes.

Looking for local web designers in Manchester? Digital Refresh is a locally based web design agency offering a range of website packages to suit all budgets.

Everything you need to
help your business thrive online.

With a comprehensive range of website design solutions catering for all budgets, we have something for every business. Whether you just want to have an online presense or a website that works for you and actively generates new enquries from your ideal customer, we can help.

Website Design

0 Comments

0
    0
    Your Cart
    Your cart is emptyReturn to Shop