Hi
This is Umang...

i m using background-color:"9E0039" in a stylesheet.css file
it is working in IE but not working in Mozilla fire fox. if i use the color name (eg. GREEN) instead of color code (eg. 9E0039) it works in Mozilla fire fox also. What should i do so that color code also work in Mozilla fire fox???

Dani AI

Generated

As described, the color rendered in IE but not in Firefox. As and correctly noted, the immediate cause is a CSS syntax problem and browsers differ in how forgiving they are. Beyond fixing the token itself, several other issues commonly produce the same symptom and are worth checking.

Common troubleshooting checklist:

  • Inspect the computed style with the browser DevTools to see which rule is applied and whether another rule overrides it (specificity, inline styles, or !important).
  • Confirm the stylesheet actually loaded (Network panel) and that the cached copy has been cleared.
  • Look for earlier syntax errors in the same stylesheet (a missing brace or unterminated string) that can cause subsequent declarations to be ignored.
  • Validate the stylesheet with a CSS validator to catch subtle parse errors.

If an alternate format is preferred, modern CSS supports RGB(A) and HSL(A) equivalents; they are fully supported across current browsers. For example:

rgb(158, 0, 57)
hsl(332, 100%, 31%)

Named colors and 3‑digit hex shorthand are also supported by browsers, but using a consistent format helps during debugging.

Reference material:

The replies from and point to the fix; the above steps help verify the stylesheet is valid and that no other rules or loading issues are preventing Firefox from showing the intended color.

Recommended Answers

All 2 Replies

If that is your actual code it should be background-color:#9E0039;

Change it to that and it should be kosher.

never use quotes in CSS unless you are combining words, like a font-famiily: "Times New Roman". And for colors, you should always [put the # before it (#9E0039). So yes, change it to bugmenot's suggestion
background-color:#9E0039;

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.