Font color won't change to white

liunx

Guest
Heres the following code:

<html>
<head>
<style type="text/css">
body { background-color: black; }
h1 { color: red; font-weight: bold; font-family: serif; font-size: 20 pt; text-decoration: underline;
text-transform: capitalize; }
p { color: white; font-weight: normal; font-family: serif; font-size: 12 pt; font-style: normal; }

</style>
</head>
</html>




The problem: When I type in text using the <p></p> the font color does not come out white. Instead it becomes invisible against a black background since the background is black as well. I even tried changing around the colors to see if it was just the white that was the issue, but I kept getting the same result. Any errors with my coding?this works for me<html>
<head>
<style type="text/css">
body { background-color: black; }
h1 { color: red; font-weight: bold; font-family: serif; font-size: 20 pt; text-decoration: underline;
text-transform: capitalize; }
p { color: white; font-weight: normal; font-family: serif; font-size: 12 pt; font-style: normal; }

</style>
</head>
<body>
<p>Testing</p></body>
</html>there must be something else interfering with it on your page?I have a DHTML Script running on my page. Is that an interference with CSS? Even if it was, it doesn't make sense to me because the <h1></h1> works just fine.DHTML is just HTML+CSS+Javascript so that script could definitely be interfering.what color is the text currently?^^^He's said already, it's black.

If there's something interacting with the CSS on your page, try overiding it by being more specific in your CSS.

perhaps try,

CSS
p#whiteText {color:#ffffff};

HTML
<p id="whiteText">White text</p>

give it a go.^^^He's said already, it's black.
lol, missed that.
Well why dont you try changing to:

body { background-color: black; color: #fff }

that or maybe DHTML messing with the <p> tags, so try:

#whitetxt {color: #fff}


<span id="whitetxt">White text is here!</span>^^^He's said already, it's black.

If there's something interacting with the CSS on your page, try overiding it by being more specific in your CSS.

perhaps try,

CSS
p#whiteText {color:#ffffff};

HTML
<p id="whiteText">White text</p>

give it a go.


Ok, I used your coding, and the text turned white. However, now the background is white. I'm thinking it's because I used this coding that another poster suggested....

body { background-color: black; color: #fff }


However, when I deleted the "color: #fff" part the background remained white. I don't get this thing haha.


And its not the DHTML script because I took the DHTML script off the page just now, and the background remained white.Ok heres an update on the situation: I went into my HTML document and typed in the following code: <body bgcolor=black>. I went to view it, and what do you know? The background went black, and the text showed up white. I put back in the DHTML script, and had no issues. So the CSS seems to work for everything else except when I tell the body background to go black. Interesting...can I just remark that from an aesthetic point of view black as a background looks pretty horrible on a monitor, if you want a black background on a monitor it almost always looks better to lean slightly to red if you're using a cool color scheme (blues cool-greys and purples) and slightly to blue if you are using a warm color scheme (reds, hot greens and yellows). This provides a small amount of extra color contrast which makes the black look blacker than if it were #000000. This has to do with the fact that the black you see on a monitor is actually much much brighter than the black your eyes sees as a result of the absence of light.
 
Back
Top