Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CSS Only Partially Executing on First View (IE Only)

Status
Not open for further replies.

drmaves

Programmer
Jun 20, 2002
12
US
I'm working on a site that was designed to load the content pane first and then the masthead, nav bar and footer.

When I first go to the site the CSS is not being recognized in the content pane; however, the masthead, nav bar and footer all look fine. If I refresh the page or move to another page and come back to the home page the CSS is used and the page looks fine.

This seems to be happening only in IE 6. I've checked this in Mozilla and Opera and they both work fine.

You can view the site at:
Any ideas on why this is happening?
 
If you do a Shift-Refresh you'll see the real CSS that should be displayed in the content pane. Now that you've visted the site it will take a while to timeout so you'll have to come back later to see what I'm talking about.
 
so whats the css isuue here? sounds like server issues
 
Maybe I'm blind but I don't see any differnece between what's displayed in IE and what's displayed in Mozilla.

There's always a better way. The fun is trying to find it!
 
Here's where I'm at...as some have suggested I've validated the CSS and the HTML and corrected any issues I found; however, I still have the problem.

When you first visit look at the main content pain while clicking the Refresh button on your browser. You should see the body copy change to a smaller size, while the rest of the page stays the same.

After this refresh there are no further problems for the current session. If you exit the browser and wait a while the CSS is removed from memory and the problem occurs again on your next visit.

Any help would be greatly appreciated.
 
You should see the body copy change to a smaller size, while the rest of the page stays the same.

It doesn't do this on my copy of IE6 - or with any of the other 5 browsers I have.

If you exit the browser and wait a while the CSS is removed from memory and the problem occurs again on your next visit.

Not entirely true! Some people change there settings to never use the cache or, in the extreme, set their cache to such a large size that it may take days or weeks to clear the cache. Could this possibly be a problem with just your machine/browser?

There's always a better way. The fun is trying to find it!
 
I have seen the problem you are describing but not on your website. I've experienced it when the connection to the webserver is slow (either because I'm downloading big files or the webserver is busy). I put it down to not being able to get the CSS file if it is separate so I just refresh it.

If you want to avoid it and you have a separate CSS file, put the CSS in each page, which kind of defeats it a little bit but the problem shouldnt occur.
 
Try putting this in the head section of your affected page(s):

Code:
<meta http-equiv="expires" content="Mon, 5 Jan 2004 11:00:00 GMT" />
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="pragma" content="no-cache" />

Hope this helps,
Dan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top