March 31st, 2003, 09:08 PM
CSS question -- incorrect display when cached
First, let me preface this question by saying that I know Netscape Navigator 4 doesn't have full support for CSS by a long shot... However, unfortunately I need to code for users of NN 4.08.
I have a seemingly strange problem: I have an HTML page in which the formatting defined in CSS breaks -- but only when the HTML page comes out of browser cache.
Specifically, here is the sequence of events:
1. Bring up your browser and clear local browser cache.
2. Type the URL to fetch the page from the web server (a different machine).
3. Page A displays perfectly.
4. Press the "reload" button in the browser (gets the page out of browser cache).
5. Page A displays incorrectly (CSS formatting breaks about halfway down the page -- incorrect text fonts, text colors, etc.).
6. Press the "shift-reload" button combination in the browser (forces the browser to re-fetch the page from the web server).
7. Page A displays perfectly again.
8. You can repeat steps 4 - 7 ad infinitum -- the test case is perfectly repeatable.
One oddity is that, although this test case is repeatable from the web server, if one is loading pages off one's local hard drive (via File -> Open Page in NN4), the page displays perfectly every time.
About the page A referred to above:
1. It has 1 HTML table in it, with 2 cells.
2. One of the cells is the main content area, and contains 5 "div" blocks, each of which contains an image and text.
3. The CSS formatting is not done via an external stylesheet; it is all defined in a "style" block above the "body" tag in the HTML file.
4. There is an external .js file which is included in the head of the HTML file, but it doesn't touch page formatting or content.
One natural thought might be to include these tags in the HTML file, to force the browser not to cache the file:
<META HTTP-EQUIV="expires" CONTENT="0">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
However, including these tags, for some reason, breaks the CSS display (incorrect fonts, etc.) when one is loading the HTML files off one's hard drive in NN4.08.
So -- Can anyone think of any reason why this strange behavior would occur, and how to circumvent it? I'm very puzzled!!!
Thank you --