Ark72
Ark72

Reputation: 21

Can't change styling in SharePoint Online

I've been trying many methods to apply custom CSS to our SharePoint Online site. However, no matter what I try, I am unsuccessful. These are the things I've tried:

  1. Created custom master page using seattle as a template. Referenced CSS under corev15.css as follows:
    <!--SPM:<SharePoint:CssRegistration Name="https://oursharepointsite.com/sites/new/SiteAssets/CSS/Custom.css?v=3" runat="server" After="corev15.css"/>-->
  2. I've used different locations for the custom.css file to see if that would make a difference (i.e. Style Library folder).
  3. I've tried the alternate URL for CSS.
  4. I've added "!important" to all of the rules in my CSS file (I know this is not a best practice).
  5. I've added webparts to a page and included CSS there (using Script Editor) but with no effect. I even tried applying styling using JavaScript. Still, no impact. I've added custom buttons and paragraphs with specific ID's and classes. I couldn't style those, either.
  6. I've also tried signing in as Global Administrator and making the changes indicated above.

The only thing that works is inline styling which of course, is impractical. I've searched various forums and have not found a solution.

Upvotes: 2

Views: 1022

Answers (1)

Judith
Judith

Reputation: 74

Are you using a completely classic site? If not, you need to look for the new way of customization.

None of the methods you describe work for the Modern experience. If you want to change the styling in any of the new Modern look, you will need to use the new Theme capability or implement something using SPFx Extensions.

You can find more about the new theming here: https://learn.microsoft.com/en-us/sharepoint/dev/declarative-customization/site-theming/sharepoint-site-theming-overview

This is a really nice tool to help you create a theme: https://developer.microsoft.com/en-us/fabric#/styles/themegenerator

This site should have everyhing else to get you started on Modern customization: https://spdesign.azurewebsites.net/

Upvotes: 2

Related Questions