How to stop flash of unstyled content

后端 未结 3 2033
生来不讨喜
生来不讨喜 2020-12-15 13:30

This is just a short question, I don\'t really have an example but the I am using a bespoke cms and at present we have no access to the head of the web page so some css has

3条回答
  •  自闭症患者
    2020-12-15 14:00

    The basic solution to handle FOUC is to keep it hidden until it has been properly styled.

    I assume that you have control over the content that is displayed unstyled? In that case, wrap it in a

    . Then use jQuery to show it when the entire document is ready:

    $(function() { $("#some-div").show(); });
    

提交回复
热议问题