PDA

View Full Version : CSS font color won't change from black


RCastro
01-20-2008, 06:30 AM
Hi all. Learning CSS and I thought I understood it pretty well until I tried it. I applied a CSS class to some text and on each page, I can't get it to change it's color from black. I can't find any #000000 in the coding and I have no clue why it wouldn't be the right color.

I uploaded a test page that you can see at:
http://www.rebeccacastrophotography.com/test.html

and the coding is:


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<style type="text/css">
<!--
body {
background-color: #736458;
}
.Bickley {
font-family: "Bickley Script";
font-size: 48px;
color: c4bab2;
}
-->
</style>
</head>
<body class="Bickley">
Why is the text on this page black??
</body>
</html>



I don't know what all the junk is at the top. DW has it there by defalt. If that is the reason for the black font color, then can I remove it, or will that mess everything up?

domedia
01-20-2008, 07:03 AM
you need a pound sign ni front of the hex numbers to make it valid CSS:
color: #c4bab2;

Cary
01-20-2008, 07:13 AM
I don't know what all the junk is at the top. DW has it there by defalt. If that is the reason for the black font color, then can I remove it, or will that mess everything up?

Removing that stuff would be a bad idea. The Doctype is very important. In this case it tells the browser that the code for the page is xhtml 1.0 transitional.

The meta tag tells the browser what character encoding is used if the server doesn't give the browser that information.

d a v e
01-20-2008, 11:31 AM
you can validate your css here
http://jigsaw.w3.org/css-validator/

and if you have firefox then download the web developer toolbar

domedia
01-20-2008, 05:08 PM
you can validate your css here
http://jigsaw.w3.org/css-validator/ Yeah, this would have shown you the error immediately.