troubleshooting Question

Simple background-color - firebrick3 works for HTML, but not for CSS

Avatar of LuluDev
LuluDev asked on
CSS
4 Comments1 Solution256 ViewsLast Modified:
I have two examples below to show the use of firebrick3 as a page background color. The HTML version works and shows firebrick3 page background; however the CSS version shows a white background. Why is there this apparent difference in the ability to use the key value firebrick3 in HTML, but not in CSS? Or is there an error in my code? I know how to get it to work in CSS ( use hex key value instead of firebrick3). But... I am curious why firebrick3 does not work and what I have to watch out for and why when using color names in CSS.

======= HTML version ===============
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>
Untitled
</title>
</head>
<body bgcolor="firebrick3">
Some body text here
</body>
</html>

======= CSS  version ================

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled</title>
<style type="text/css">
<!--
/* I cannot get background:firebrick3 to work! But using hex will work #C11B17 */
body {background: firebrick3;}
-->
</style>
</head>
<body>
Some body text here
</body>
</html>
ASKER CERTIFIED SOLUTION
TedInAK

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 4 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros