none
Apply Custom Css file in Masterpage 2013

    Question

  • Hi,

    I am trying to apply custom css and js to a my.sharepoint.com site with no luck.  It's not reading the css or js files. It's SP 2013 hosted in the cloud with an E3 license.  I have a basic link to the css which works great in other site collections.

    Any help would be appreciated.

    Thanks!

    Tuesday, August 12, 2014 5:59 PM

Answers

All replies

  • Hi  ,

    Master Pages reference the stylesheets. All the personal sites use the default mysite.master in the root site collection for mysites. Open the root site collection in sharepoint designer ie http://mysites/. Open Master Pages and you will see mysite.master. Edit the master page in sharepoint designer and insert the following line just before of the closing </head> tag.

    <SharePoint:CssRegistration name=”<% $SPUrl:~sitecollection/Style Library/yourCSSfile2.css %>” runat=”server”/>

    note the "$SPUrl:~sitecollection" is a resource token which is the current site collection.

    You can select the master page to use for all mysites

    Reference: http://social.msdn.microsoft.com/Forums/sharepoint/en-US/8e405257-2963-4db6-86e4-11c4ec6e8ef5/applying-custom-masterpage-and-css-styles-to-mysites 

    http://office.microsoft.com/en-in/sharepoint-designer-help/customize-your-my-site-master-page-HA102752026.aspx

    Best Regards,

    Eric


    Eric Tao
    TechNet Community Support



    Thursday, August 14, 2014 7:58 AM
  • Hi,

    Thank you for your reply.

    Using <SharePoint:CssRegistration name=”<% $SPUrl:~sitecollection/SiteAssets/MySites.css %>” runat=”server”/> breaks the master page in 2013. 

    I've tried:

    <!--SPM:<link href="https://my.sharepoint.com/SiteAssets/MySites.css" rel="stylesheet" type="text/css" />-->

    <link href="https://my.sharepoint.com/SiteAssets/MySites.css" rel="stylesheet" type="text/css" />

    But the link to the core styles works fine.

      <link href="https://my.sharepoint.com/_layouts/15/1033/styles/corev15.css" type="text/css" rel="stylesheet" />

    Thanks!

     

     

     

    Thursday, August 14, 2014 10:54 PM
  • Hi,

    For your issue, it should be caused by that the MySite.css has not been published. You can upload MySite.css to Style Library and  publish it. Then you can try to apply it to SharePoint 2013 Online Master Page.

    Best Regards,

    Eric


    Eric Tao
    TechNet Community Support

    Friday, August 15, 2014 3:08 AM
  • The problem ended up being that I couldn't apply styles to oslo.html, only to mysite.master.  I'll start from there.

    Thx!

    • Marked as answer by Lorena423 Friday, August 22, 2014 8:22 PM
    Friday, August 15, 2014 3:28 PM