tags:

views:

64

answers:

2

I have a div (.header) contained within other divs. When my page loads, momentarily just that one .header div "flashes" white as the page is loading, especially in in Firefox, but a little bit in IE8 too. I can't find what kind of CSS or lack thereof is causing this - there's no images or background color associated with that div. There is a logo.png within the .header. Thoughts?

http://dev.bwmsnow.co.nz/

+1  A: 

From what I can see (Firefox on XP) it doesn't so much flash as it looks like it is slow to load the header-container div, and the associated background images. If I load without cache the whole of the logo bar loads last (and is white before load), but not just the one div. YSlow counts some 50 HTTP requests which might explain some of it. It doesn't look like the page is large so much as made up of a lot of pieces that probably create some processing lag.

acrosman
I plan on optimizing when I'm done, ie, using YSlow, and this site (Magento) has some built in JS/CSS minifier, so maybe that'll fix it. I think you are on target that it's simply the last to load and is white till then. Is there an easy enough way to get it to load before the others (without messing too much with the existing code)?
Joe Fletcher
+1  A: 

If I understand the question, my suggestion is an old trick of adding a background color similar to the background image to <div class="header"> so that as the page loads (but before the image loads) the user sees a color similar to the background image. That way the visual impact of the image loading is not as noticeable.

I Photoshop eye dropped your background image and suggest using #a1dff8 as the color. The CSS for should be:

.header{
background:#a1dff8 url('images/yourheader.png');
}

Also, when looking at your code, I see that you have several external JS files. You should consider a minifier. Just Google or StackOverflow for JS/CSS minification.

Christopher Altman
In this particular instance I don't think that would work, because div.header has no background image. The header background image is actually on the body element. So if div.header was given a background color it would actually cover up the background image.
Jonathan Nicol
You are right. So what I would do is move the background image into the header div. That way it will work.I took a look at your website, f6design.com, and really like the design. Very cool.
Christopher Altman