Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    Senior Coder effpeetee's Avatar
    Join Date
    Feb 2007
    Location
    Clapham Junction - London SW
    Posts
    4,885
    Thanks
    228
    Thanked 204 Times in 203 Posts

    Exclamation font-color:#FFFFFF has not altered the font color.

    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

    Code:
    <!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>
    Last edited by effpeetee; 06-04-2007 at 06:04 PM. Reason: correcting text.

  • #2
    Senior Coder Arbitrator's Avatar
    Join Date
    Mar 2006
    Location
    Splendora, Texas, United States of America
    Posts
    3,387
    Thanks
    32
    Thanked 288 Times in 282 Posts
    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.

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

    Code:
    <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.
    Last edited by Arbitrator; 06-04-2007 at 06:20 PM. Reason: I pointed out some other problems with the code.
    For every complex problem, there is an answer that is clear, simple, and wrong.

  • #3
    Senior Coder effpeetee's Avatar
    Join Date
    Feb 2007
    Location
    Clapham Junction - London SW
    Posts
    4,885
    Thanks
    228
    Thanked 204 Times in 203 Posts
    Quote Originally Posted by Arbitrator View Post
    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.

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

    Code:
    <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

  • #4
    Senior Coder effpeetee's Avatar
    Join Date
    Feb 2007
    Location
    Clapham Junction - London SW
    Posts
    4,885
    Thanks
    228
    Thanked 204 Times in 203 Posts
    Quote Originally Posted by effpeetee View Post
    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

  • #5
    Senior Coder Arbitrator's Avatar
    Join Date
    Mar 2006
    Location
    Splendora, Texas, United States of America
    Posts
    3,387
    Thanks
    32
    Thanked 288 Times in 282 Posts
    Quote Originally Posted by effpeetee View Post
    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:

    Code:
    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.
    For every complex problem, there is an answer that is clear, simple, and wrong.

  • #6
    Senior Coder effpeetee's Avatar
    Join Date
    Feb 2007
    Location
    Clapham Junction - London SW
    Posts
    4,885
    Thanks
    228
    Thanked 204 Times in 203 Posts
    Arbitrator,

    I'm getting careless in my old age.

    Black mark Taylor!

    Thanks again for your help.

    effpeetee


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •