Forum Home
Press F1
 
Thread ID: 23142 2002-08-08 09:58:00 Background Color is not displayed when back button is pressed. Graham Petrie (449) Press F1
Post ID Timestamp Content User
69386 2002-08-08 09:58:00 Could someone please check this out for (to make sure I am not seeing things) and try to sort the problem out for me.

When on my site (http://www.knightguider.orcon.net.nz) and I click on the "What's On" link at the top of the page, wait for the page to load, and then click the back button. The startpage loses it's background colour.

I am using the following style sheet to specify the background colour:

kg.css follows

BODY
{
font-family: sans-serif;
font-weight: bold;
font-size: 12pt;
background-color: #ffffcc;
scrollbar-3dlight-color:#333333;
scrollbar-arrow-color:#ffff33;
scrollbar-base-color:#000000;
scrollbar-darkshadow-color:#666666;
scrollbar-face-color:#000000;
scrollbar-highlight-color:#333333;
scrollbar-shadow-color:#000000;
scrollbar-track-color:#ffffcc;
}

The code for the site can be viewed as normal.

G P
Graham Petrie (449)
69387 2002-08-08 10:00:00 Yep - sure does.

Neat trick, if only you could figure out how you did it..
godfather (25)
69388 2002-08-08 10:02:00 I think it has something to d with the style sheet not loading the color again on back. A refresh (no ctrl key required) fixes it. How the heck is it doing it???? Didn't used to - only since I added the what's on link, but every link causes the problem.

G P
Graham Petrie (449)
69389 2002-08-08 10:05:00 I dont know much about HTML but you could try an absolute path the the .css file. robsonde (120)
69390 2002-08-08 10:08:00 GP, I'm using Mozilla and I don't see any background colour (except white). That includes the first loading of the page and regardless of moving back/forward or refresh/reload. What colour was it supposed to be?

Babe.
Babe Ruth (416)
69391 2002-08-08 10:09:00 OK, just tried that, but it didn't work.

Sorry.

G P
Graham Petrie (449)
69392 2002-08-08 10:31:00 Light yellow (same as the backgound of the images). Does Mozilla support .css style sheets? Some browsers don't, and just apply the normal formatting - I guess that is one disadvantage of using them. Still alot better than the <font> tags as far as the author of the site is concerned

G P
Graham Petrie (449)
69393 2002-08-08 10:49:00 GP, Yup Cascading Style Sheets: * CSS1 * CSS2 (partial support at this time) Babe Ruth (416)
69394 2002-08-08 11:00:00 Had a look at it with Homesite and used the Document Validator. There are several minor errors with your code. Try hunting for a validator on the web to spot your errors. One of these errors may, for some obscure reason, be causing the fault. Heather P (163)
69395 2002-08-08 11:02:00 GP:

A work around, and a also a way to keep cross browser compatibility, is to also specifiy background colour in the them tags eg:


<BODY background=#ffffcc>

Also, it is better (theoretically) to place style definitions within the HTML page rather as a link:
[pre]
<HEAD>
<style type="text/css">
<!--
body {
background-color: #FFFFCC;
}
-->
</style>
</head>

Of course not many people do this because it is way easier to edit one external style sheet than every style on every page...
Elwin Way (229)
1 2