Linking an external stylesheet to a SharePoint 2013 page

Matt-9236 201 Reputation points
2021-10-19T12:23:08.733+00:00

Hi,

I'm not sure how best to word this question, so I apologise if it isn't very clear.

I've recently designed a website using Visual Studio Code. I now need to replicate this website on a SharePoint 2013 site.

I understand that I can upload my stylesheets to the Site Assets library on the SharePoint site and link to them via Content Editor web parts on the Sharepoint site pages. However, I'm not sure how to update the stylesheets to bypass any CSS formatting already built in to the SharePoint pages.

To clarify, the website looks fine when viewed through the Live Server browser on VSC, but when I link to the same code from a SharePoint page it doesn't! Are there any simple changes I can make to the code for it work effectively on SharePoint? Or is it not that simple to replicate a webpage on a SharePoint page?

Thanks

SharePoint Server
SharePoint Server
A family of Microsoft on-premises document management and storage systems.
2,209 questions
SharePoint Server Management
SharePoint Server Management
SharePoint Server: A family of Microsoft on-premises document management and storage systems.Management: The act or process of organizing, handling, directing or controlling something.
2,795 questions
0 comments No comments
{count} votes

Accepted answer
  1. MichaelHan-MSFT 18,016 Reputation points
    2021-10-20T02:36:00.457+00:00

    Hi @Matt-9236 ,

    To override css we usually use !important after every attribute of css. For example:

    .CssClass{  
     color: red !important;  
    }  
    

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.



0 additional answers

Sort by: Most helpful