Custom CSS RRS feed

  • Question

  • Hi All,

    I would like to add my own external style sheet to the master page, but it does not appear to be working. I have placed what I believable is the correct link in the master page:

    <SharePoint:CssRegistration  name="/Style Library/Custom.css" runat="server" After="corev15.css"/>

    The above does not do anything. Does anyone know how to add an external style sheet to the master page?

    Many thanks


    Wednesday, December 13, 2017 2:44 PM

All replies

  • <SharePoint:CssRegistration  name="</Style Library/Custom.css>" runat="server" After="corev15.css"/>

    Hi Kieran- it's probably not working because the SharePoint CSS is overriding yours. Make sure you place your style sheet in the correct place for the page load order.

    Looked at your code closer- looks like you need <> around your URL.

    cameron rautmann

    • Edited by croute1 Wednesday, December 13, 2017 4:40 PM
    Wednesday, December 13, 2017 4:28 PM
  • Hi Kieran,

    We can use html tag to achieve it.

    Here is a demo for your reference.

    <link rel="stylesheet" type="text/css" href="/sites/team1/MyDocLib/Custom.css" />

    My Custom CSS style as below.

    Screenshot of result.

    Best regards,

    Lee Liu

    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact

    Thursday, December 14, 2017 6:37 AM
  • Hi,

    SharePoint CSS control need to access your site collection URL, please update this like below

    <SharePoint:CssRegistration name="<%$SPrl:~SiteCollection/Style Library/Custom.css" runat="server" After="corev15.css"/>

    Murugesa Pandian MCSA,MCSE,MCPD
    Please remember to mark the replies as answers or helpful if they really helped and saved your time.

    Thursday, December 14, 2017 7:34 AM