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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CSS Background color in Mozilla?

Status
Not open for further replies.

Einstein47

Programmer
Nov 29, 2001
737
US
I am trying to move all the color definitions for my site from hardcoded to a stylesheet. Everything works fine in IE when I do
Code:
<TD class=&quot;header&quot;> ... </TD>
both the background and text are the correct colors.

This is my &quot;header&quot; class definition:
Code:
.header {
  color: black;
  background: #ffc800;
  background-color: #ffc800;
}

However, in Mozilla everything comes up black. You can only read the text when you select it with the mouse. Is there some trick to make Mozilla use the color definitions for table cells that you put in the CSS class? Einstein47
(&quot;If computers ever get too powerful, we can organize them into a committee - that will do them in.&quot; - Unknown)
 
Try losing the
Code:
background
attribute --
Code:
background-color
does the same thing more explicitly. Could be the browser is confused by the redundant instruction.
 
I tried that - no luck. Here is the link

Load it in IE first - then Mozilla to see where the colors are black. It really stinks. I hate having colors hard-coded in my HTML so putting it in the CSS seems to be the best way. However, Mozilla isn't as &quot;standards compliant&quot; as they profess. Either that or I'm really goofing something up bad and IE lets it slide.

Any help appreciated and rewarded. Einstein47
(&quot;If computers ever get too powerful, we can organize them into a committee - that will do them in.&quot; - Unknown)
 
It seems that my problem is that I am trying to pull in an external stylesheet. I use this code:
Code:
<link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;standard.css&quot;>
and I gets some of my deffinitions, but not all of them. Maybe I have an error in the standard.css file and IE ignores it and Mozilla doesn't - hmmm Einstein47
(&quot;If computers ever get too powerful, we can organize them into a committee - that will do them in.&quot; - Unknown)
 
Found it!

I was missing a closing brace }

Funny that IE allowed it. Well, so now everyone knows. Einstein47
(&quot;If computers ever get too powerful, we can organize them into a committee - that will do them in.&quot; - Unknown)
 
Mozilla and my HTTP server have issues in the area of external css files. Specifically, Mozilla (1.0.1, Gecko 20020815)ignores external stylesheets presented by my server. This is reproducible behaviour -- the same stylesheets embedded in the html document work fine. I moved non-performing sources (with external css) to my ISP's Apache server and Mozilla rendered the document just fine. (Maybe a wee bit better than IE ...)

Workarounds include not using external css, moving to a different server. One benefit is you see how your document looks to a non-css-capable browser. (Of course, you can do the same thing in any browser by deleting the css link.)

I recall seeing a mention of some disagreement over how external css packets are labeled, that Mozilla was enforcing the letter of specification.

BTW, my vendor was quite helpful until stripped of deny-ability. Now they are quite silent.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top