locked
Change calender font color from bold blue to black? RRS feed

  • Question

  •  

    Hi,

    I have a calender in a sharepoint site.

    The current font color of the text is in bold blue color.

    I want to chage the fornt color to black!

     

    I got some script,I am unable to complete it.


    <script type="text/javascript" language="javascript">
    var x = document.getElementsByTagName("TD")
    var i=0;
    for (i=0;i<x.length;i++)
    {
      if (x[i].className.substring(0,6)=="ms-cal")
      {
        x[i].innerHTML= x[i].innerHTML---------------------?
      }
    }
    </script>



    Please help me.

    Thanks!

    Thursday, July 23, 2009 4:30 PM

Answers

  • I don't think you want to do this with script.  All you really need is CSS to override the default colors from core.css.  So, for instance, on the month view (calendar.aspx), the events are shown with the CSS class ms-cal-monthitem.  To change the color of these links to black:

    td.ms-cal-monthitem a {
     color:#000000;
    }

    If you could tell me what view you are referring to, I could give you the CSS class(es) for it.  You should get the Internet Explorer Developer Toolbar (Bing it) to look into the DOM for CSS.

    M.

    Marc D Anderson - Sympraxis Consulting LLC - Marc D Anderson's Blog
    Friday, July 24, 2009 4:03 AM

All replies

  • I don't think you want to do this with script.  All you really need is CSS to override the default colors from core.css.  So, for instance, on the month view (calendar.aspx), the events are shown with the CSS class ms-cal-monthitem.  To change the color of these links to black:

    td.ms-cal-monthitem a {
     color:#000000;
    }

    If you could tell me what view you are referring to, I could give you the CSS class(es) for it.  You should get the Internet Explorer Developer Toolbar (Bing it) to look into the DOM for CSS.

    M.

    Marc D Anderson - Sympraxis Consulting LLC - Marc D Anderson's Blog
    Friday, July 24, 2009 4:03 AM
  • Thank You Very much Marc!!!!!!!!!
    Friday, July 24, 2009 1:59 PM
  • I am referring to month view, I have added this script in the content editor webpart


    <style type="text/css">
    td.ms-cal-monthitem a {
     color:#000000;
    }
    </style>


    This is not working.

    Please advise me!

    Friday, July 24, 2009 2:11 PM
  • Hey I fixed it by using this script

     

    <style type="text/css">
    td.ms-cal-defaultbgcolor a,td.ms-cal-monthAllDay a{
    color:#000000;
    text-decoration:none;
    }

    </style>

    Friday, July 24, 2009 2:34 PM
  • Great. All depends on what you wanted to change, of course!

    M.


    Marc D Anderson - Sympraxis Consulting LLC - Marc D Anderson's Blog
    Friday, July 24, 2009 2:54 PM