...

View Full Version : font-color:#FFFFFF has not altered the font color.



effpeetee
06-04-2007, 06:02 PM
Hello fellow coders,

Another fun-filled, action-packed day!
To the matter in hand.

The following code does not do what I want it to do. Namely to change the caption from black to white. If someone would point out my error, I would be grateful.

URL http://www.exitfegs.co.uk/20a.html

effpeetee


<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>We've lost our way</title>
<style type="text/css">
body{background:#000000}
#main {
width: 1200px;
margin: auto;
}
#main.figure {
float:right;
width:200px;
margin-bottom:0px;
margin-left:110px;
position:absolute;
}

#main .figure p {
position:absolute;
width:290px;
left: 410px;
top: 352px;
font-size:.9em;
font-weight:bold;
font-color:#ffffff/*This does not alter the font color - why not?*/ text-align:center;
padding: 5px;
margin: 0;
}

#main .figure img
{
display: block;
}

</style>
</head>

<body class ="" id="main">

<div class="figure">
<A href="Picchoose.html"><IMG style="LEFT: -5px; POSITION: absolute; TOP: -3px" height=728 alt="Click to move on" src="19.jpg" width=1024 84px; POSITION: absolute; TOP: 15px?></A><p>We should have turned left at the crossroads.</p></div>

</body>
</html>

Arbitrator
06-04-2007, 06:11 PM
The property used to change the font color is simply called color in CSS. Iím not sure why the W3C was inconsistent when naming that property.

You may also want to fix your syntax (line breaks added for readability):


<IMG style="LEFT: -5px; POSITION: absolute; TOP: -3px"
height=728
alt="Click to move on"
src="19.jpg"
width=1024
84px; POSITION: absolute; TOP: 15px?>

Personally, I would also always quote your attribute values for consistency and would avoid use of the style attribute entirely. With regard to the latter, itís easier to maintain your documents if you keep all CSS within either style elements or an external CSS file.

effpeetee
06-04-2007, 06:20 PM
The property used to change the font color is simply called color in CSS. Iím not sure why the W3C was inconsistent when naming that property.

You may also want to fix your syntax (line breaks added for readability):


<IMG style="LEFT: -5px; POSITION: absolute; TOP: -3px"
height=728
alt="Click to move on"
src="19.jpg"
width=1024
84px; POSITION: absolute; TOP: 15px?>

Personally, I would also always quote your attribute values for consistency and would avoid use of the style attribute entirely. With regard to the latter, itís easier to maintain your documents if you keep all CSS within either style elements or an external CSS file.
Arbitrator:

I have altered it to just color:#FFFFFF and I have also tried color=#FFFFFF but the text stays black.

effpeetee

effpeetee
06-04-2007, 06:24 PM
Arbitrator:

I have altered it to just color:#FFFFFF and I have also tried color=#FFFFFF but the text stays black.

effpeetee
Arbitrator:

I have altered it to just color:#FFFFFF and I have also tried color=#FFFFFF but the text stays black.

effpeetee

Arbitrator
06-04-2007, 06:26 PM
I have altered it to just color:#FFFFFF and I have also tried color=#FFFFFF but the text stays black.Your page doesnít seem to be updated to reflect the change. However, I would hazard a guess that the problem is because you forgot the semicolon for the declaration:


color:#ffffff;/*This does not alter the font color - why not?*/

Youíre only allowed to omit the semicolon from the last declaration in a declaration block (a declaration block is delimited by curly brackets ({ and })) and I would not even do that.

effpeetee
06-04-2007, 06:33 PM
Arbitrator,

I'm getting careless in my old age.

Black mark Taylor!

Thanks again for your help.

effpeetee



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum