question

EliasBalesamang-6774 avatar image
0 Votes"
EliasBalesamang-6774 asked sadomovalex answered

Custom masterpage on sharepoint 2019 on classic site

I manage to create masterpage on sharepoint 2019 but i failing to att css on the master page, it does not render my css on the master page . My css on my html file look as follows:

<!--MS:<SharePoint:CssRegistration Name="Themable/corev15.css" runat="server">-->
<!--ME:</SharePoint:CssRegistration>-->
<!--SPM:<SharePoint:CssRegistration ID="CustomCSS" name="&#60;% $SPUrl:~SiteCollection/_catalogs/masterpage/Bob/style.css%&#62;" After="corev15.css" runat="server"/>-->
<!--SPM:<SharePoint:CssRegistration ID="CustomCSS1" name="&#60;% $SPUrl:~SiteCollection/_catalogs/masterpage/Bob/grid.css%&#62;" After="corev15.css" runat="server"/>-->

It always uses corev15.css, it does not load my custom css at all .

Thank you

office-sharepoint-server-customization
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

sadomovalex avatar image
0 Votes"
sadomovalex answered

did you check html output: does it have <link rel="stylesheet"> tag which points to your file?
Also can you access your css by direct url: http://MySiteCollection/_catalogs/masterpage/Bob/grid.css? Was it published with major version and approved (if approval workflow is in use).

Also you may add custom css to OTB master page without creating custom master page. For doing that go to Site settings > Master page > Alternate css and set link to custom css file there. It will override OTB styles on pages.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

EliasBalesamang-6774 avatar image
0 Votes"
EliasBalesamang-6774 answered EliasBalesamang-6774 edited

@sadomovalex
I did check the html output and it is like this see attached pdf127995-untitled-document.pdf

It is published as major version and (approval is not in use)
I need this since i need to do full customizing



5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

MichaelHan-MSFT avatar image
0 Votes"
MichaelHan-MSFT answered

Hi @EliasBalesamang-6774,

By default, if you define styles in a custom .css file that are also defined in corev15.css, they are overwritten.

You could try to use the !important rule in your custom css, check if works for you.


If an Answer is helpful, please click "Accept Answer" and upvote it.
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.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

EliasBalesamang-6774 avatar image
0 Votes"
EliasBalesamang-6774 answered

Something strange had happen on firefox it is rendering but with this
The stylesheet http:// domain/_catalogs/masterpage/Bob/grid.css was not loaded because its MIME type, “application/octet-stream”, is not “text/css”.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

sadomovalex avatar image
0 Votes"
sadomovalex answered

check this post about similar issue with MIME type mismatch: SharePoint 2019 not loading style sheets in document libraries.




5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.