0

I have a question about custom styles in SharePoint. I know that custom styles can be added by using the seattle.html file. But there are some codes that I dont understand. So let me tell you, if I add a new style I use the <head> and paste the location (Option 1) to the css file. But there are two options to do this:

This is the normal way I ever take: Option 1:

<head>
     <link rel="stylesheet" type="text/css" href="https://example.com/cssstyle/Mystyle.css">
</head>

Option 2:

<head>
     <SharePoint:CssRegistration Name="https://example.com/cssstyle/Mystyle.css" runat="server" />
</head>

My question is, where are the differences between this two options. Which option should I use to add a custom style?

Thanks for comming answers!

1

Even though both of them do the same thing of attaching a css file to the page. The Sharepoint:CssRegistration has a little more advantages with respect to functionalities it can support. If you want your css to be loaded after another css or specify sharepoint relative urls to point to then you can use the SharePoint:CssRegistration . Please find below a blog post discussing the advantages of using it. sharepoint-cssregistration-or-link ?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.