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 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Jan 2004
    Location
    MD
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Help - I can't get the font color to change

    I am trying to get the color of my current date to change to white rather than black. I can't seem to get it to work any help will be greatly appreciated.
    here is the code:
    <td
    style="vertical-align: bottom; background-color: rgb(102, 0, 0);">
    <script>
    /*Current date script credit:
    JavaScript Kit (www.javascriptkit.com)
    Over 200+ free scripts here!
    */

    var mydate=new Date()
    var year=mydate.getYear()
    if (year < 1000)
    year+=1900
    var day=mydate.getDay()
    var month=mydate.getMonth()+1
    if (month<10)
    month="0"+month
    var daym=mydate.getDate()
    if (daym<10)
    daym="0"+daym
    document.write("<small><font color='ffffcc' face='Arial'><b>"+month+"/"+daym+"/"+year+"</b></font></small>")
    </script>
    <br>
    </td>

    this is the page:
    http://www.webspace.umd.edu/amercult...T1/index2.html
    Last edited by tmatava; 08-19-2004 at 05:07 PM.

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    Wichita
    Posts
    3,880
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Code:
    <td
    style="vertical-align: bottom; background-color: rgb(102, 0, 0);font-size: smaller; color: #ffc;font-family: Arial;font-weight: bold;">
    <script>
    /*Current date script credit:
    JavaScript Kit (www.javascriptkit.com)
    Over 200+ free scripts here!
    */
    
    var mydate=new Date()
    var year=mydate.getYear()
    if (year < 1000)
    year+=1900
    var day=mydate.getDay()
    var month=mydate.getMonth()+1
    if (month<10)
    month="0"+month
    var daym=mydate.getDate()
    if (daym<10)
    daym="0"+daym
    document.write(month+"/"+daym+"/"+year)
    </script>
    <br>
    </td>
    Try it using pure CSS instead of partly CSS and partly presentational html.
    Check out the Forum Search. It's the short path to getting great results from this forum.

  • #3
    New to the CF scene
    Join Date
    Jan 2004
    Location
    MD
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    It worked!

    Roy - thanks for the code - it looks great!


  •  

    Posting Permissions

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