My Blog

contains PHP and other web related content. (Sometimes there are some off topic things - don't freak out!)

Flash of Unstyled Content – in FireFox 3

So I’ve heard of the Flash of Unstyled Content before – but never really had this problem. I always use a LINK tag for my stylesheets.

However, I just ran into it today – in FireFox even with a LINK tag…

Fixing Flash of Unstyled Content in Firefox

Simple really – I was loading way too much javascript before my stylesheet (not my fault on the large amount of js!!) – and the delay was causing the flash. I moved the link to the very first part of the content – and presto – good to go.

So, instead of

1
2
3
4
5
6
7
<head>
<script src="#"></script>
<script src="#"></script>
<script src="#"></script>
<script src="#"></script>
<link href="#" type="text/css" rel="stylesheet" />
</head>

Just move it to the top:

1
2
3
4
5
6
7
<head>
<link href="#" type="text/css" rel="stylesheet" />
<script src="#"></script>
<script src="#"></script>
<script src="#"></script>
<script src="#"></script>
</head>

… next battle, getting rid of sooo much js ;)

Tags: , ,

Leave a Reply

  • twitter loader

Follow me on twitter: @aaronsaray

The views on this website are my own and do not reflect the opinions of my employer or clients.
Creative Commons License Home | Open Source | Book | Music | Art | Bio | Resume | Contact
My Baby