Actually, this is more of an error description than a question.
I noticed flash of unstyled content (FOUC) in Firefox on a very simple login page. There are no images used. No heavy CSS. All Javascript placed at the end of the code, right before the closing body tag. But when the page loads, Firefox shows a completely unstyled page for about 100 ms and then the css takes effect. This happens everytime, without exception.
Accidently I found some sort of a hack to solve this:
Just add a <script>
element to the <head>
, place any javascript code you like in it or even a simple comment and - bam! - problem solved. Like this:
<script>/* foo */</script>
The actual reason for that FOUC seems to be the use of the autofocus attribute with one of the form fields. So removing 'autofocus' solves the problem too.
Isn't that weird?
Does anyone know a better solution than mine?