locked
Calendar not getting CSS in 2010. But it does in SPD?? RRS feed

  • Question

  • I create an OOB Calendar list but for some reason, it doesn't get the calendar.css and datepicker.css assigned to it. Obviously, this make it look ugly and unusable..I compare it with my 2007 environment and notice that the following is missing from the source:

    <link href="/_layouts/1033/styles/calendar.css?rev=BrbrIU86qTG2EHx1ZUuFBQ%3D%3D" rel="stylesheet" type="text/css"/>

    <link href="/_layouts/1033/styles/datepicker.css?rev=RMwQ2fgYuOqghGrrmOcjLQ%3D%3D" rel="stylesheet" type="text/css"/>

    Here is the weird part.. I open the list in Sharepoint Designer and see the calendar displaying correctly. Why is the css reference not being embedded in calendar.aspx??

    • Moved by Hemendra Agrawal Wednesday, January 16, 2013 11:09 AM not programming question
    Tuesday, January 15, 2013 6:47 PM

All replies

  • Hi,

    In sharepoint 2010, you have to add following css inorder to get your calender list looking as expected.

    Although it comes by its own but it seems it is not coming in your case. 

    http://<site>/_layout/1033/styles/Themable/calendarv4.css

    similarly ,

    http://<site>/_layout/1033/styles/Themable/datepickerv4.css

    Let me know if this helps !!


    Thanks, Ali Yasir

    Tuesday, January 15, 2013 9:26 PM
  • I would use Alternate CSS first. But other options are:
    • If you put the CSS file in Style Library, you can do this:

      < SharePoint:CssRegistration name="<% $SPUrl:~SiteCollection/Style Library/custom.css%>" runat="server"/>

    • Put the CSS on the server as 14\TEMPLATE\LAYOUTS\1033\STYLES\custom\custom.css and then you can do this:

      < SharePoint:CssRegistration name="custom/custom.css" runat="server"/>

    Putting the file into its own directory is considered best practice so that it does not interfere with updates to out of the box files.

    Wednesday, January 16, 2013 1:49 AM
  • Hi Indul,

    Kindly do not self propose your answer.


    Thanks, Ali Yasir

    Wednesday, January 16, 2013 5:16 AM
  • Hi

    be sure that your style is loaded and not overwrited

    To check which style is applied, use a dev tool for ex IEplorer F12, and select your element to see what style is applied or not

    to avoid and be sure that is applied your style, in your css file insert after each style  "!important"

    like

    {
    background-color:red!important;
    }


    Romeo Donca, Orange Romania (MCSE, MCITP, CCNA) Please Mark As Answer if my post solves your problem or Vote As Helpful if the post has been helpful for you.

    Wednesday, January 16, 2013 2:02 PM
  • In shrepoint If you want to change the style of Calender then you need to chage the css class of coreV4 of sharepoint default css by using !important at you custom css.

    Ritu Ranjan

    Thursday, January 17, 2013 5:54 AM
  • I don't want to change my style, I just want to apply one because there is no css referenced. For some reason, I cannot add these references in the master page without breaking the whole site (I think it is because of ghosting and customization).

    I am able to apply the datepicker.css at the list level but didn't realize there was a datepickerv4.css so I will attach that (along with calendarv4.css) to the calendar.aspx

    When I check the developer tools / Styles in IE, these css files do not show up in the drop down list as they do in my 2007 version. 

    Friday, January 18, 2013 8:11 PM
  • Yes, as I suggested above try applying calendarv4.css and let me know your observation.


    Thanks, Ali Yasir http://www.sharepointstack.blogspot.in/

    Friday, January 18, 2013 8:29 PM
  • I am only able to use the 'attach style sheet' functionality in Sharepoint Designer as everything is based on site definitions and customizations will break the page. Which is not ideal but calendarv4.css makes no change to the view whereas calendar.css does format it correctly
    Friday, January 18, 2013 8:41 PM
  • Hi,

    let me guess you all have not no SiteCollection on root-level ?!?!

    I had the missing styles problem for over a year on my developer machine. But i could ignore it since it the problem never existed after deployment to other servers like testserver...

    After I created a SiteCollection on root-level without a managed path:

    http://servername:port/

    The problem was gone. I think it doesn't even matter what kind of SiteCollection you choose.

    Hope this will help you!


    • Edited by Felix L. _ Friday, October 25, 2013 1:39 PM typo
    • Proposed as answer by edgar2412 Thursday, June 23, 2016 7:27 PM
    Friday, October 25, 2013 1:38 PM