none
How to override core15 css with custom Css in custom master page in sharepoint RRS feed

  • Question

  • Hi All,

    I have facing Css Overriding issue .I have two css in my custom master page 1) corev15.css  2) Main.css .

    Problem is that my default corev15.css Override Main.css at some places (not at all).i want that my custom main.css orverride default one.


    eg:I have html control type  button

    in corev15  css apply on input type

    in main(custom css) css apply on class of html button.

    so it taking css of corv15 not main.i want it should take main css

    Please suggest me 

    Thanks in advancedCss Override


    • Edited by KhanWay9 Thursday, June 13, 2019 7:34 PM
    Thursday, June 13, 2019 7:15 PM

All replies

  • Does it work if you put your custom css just behind the corev15.css with the same format?

    Means using <SharePoint:CssRegistration> node.


    Justin Liu Office Apps & Services MVP, MCSE
    Senior Software Engineer
    Please Vote and Mark as Answer if it helps you.

    Friday, June 14, 2019 2:21 AM
  • Hi KhanWay9, 

    To override core15 css with custom Css in custom master page in sharepoint, refer to the following article:

    http://preachingsharepoint.blogspot.com/2013/04/overriding-default-css-with-yopur-own.html

    Similar issue post  for your reference:

    https://sharepoint.stackexchange.com/questions/144560/how-to-reference-a-custom-css-file-on-the-master-page-in-foundation-with-spd

    Best Regards, 

    Lisa Chen 


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    SharePoint Server 2019 has been released, you can click here to download it.
    Click here to learn new features. Visit the dedicated forum to share, explore and talk to experts about SharePoint Server 2019.

    Friday, June 14, 2019 8:24 AM
    Moderator
  • I have tried but still some css override by corev15.css.Please find screen shot
    Friday, June 14, 2019 9:26 AM
  • Hi KhanWay9, 

    You can make the change in .master page instead of .html page.

    Best Regards, 

    Lisa Chen 


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    SharePoint Server 2019 has been released, you can click here to download it.
    Click here to learn new features. Visit the dedicated forum to share, explore and talk to experts about SharePoint Server 2019.

    Friday, June 14, 2019 9:31 AM
    Moderator
  • i have tried but did not get result

    chnages in .master insted of html

    <SharePoint:CssRegistration Name="Themable/corev15.css" runat="server">
            </SharePoint:CssRegistration>
            <SharePoint:CssRegistration Name="/SiteAssets/styles/animate.css" runat="server" After="corev15.css">
            </SharePoint:CssRegistration>
            <SharePoint:CssRegistration Name="/SiteAssets/styles/vendor.css" runat="server" After="corev15.css">
            </SharePoint:CssRegistration>
            <SharePoint:CssRegistration Name="/SiteAssets/styles/bootstrap.css" runat="server" After="corev15.css">
            </SharePoint:CssRegistration>
            <SharePoint:CssRegistration Name="/SiteAssets/styles/main.css" runat="server" After="corev15.css">
            </SharePoint:CssRegistration>

    Friday, June 14, 2019 12:19 PM
  • Hi KhanWay9,

    Add "!important" at the end of the CSS in main.

    The "!important" is a key word which is added to the end of the CSS value to give it more weight. 

    Reference:

    https://techinterviewpuzzles.appspot.com/articles/CSS/What-does--important-mean-in-CSS-with-Example-

    Best Regards,

    Lisa Chen


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    SharePoint Server 2019 has been released, you can click here to download it.
    Click here to learn new features. Visit the dedicated forum to share, explore and talk to experts about SharePoint Server 2019.

    Tuesday, June 18, 2019 8:39 AM
    Moderator
  • Hi KhanWay9,

    If the reply is helpful to you, you could mark the reply as answer. Thanks for your understanding.

    Best regards,

    Lisa Chen 

    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    SharePoint Server 2019 has been released, you can click here to download it.
    Click here to learn new features. Visit the dedicated forum to share, explore and talk to experts about SharePoint Server 2019.

    Tuesday, June 25, 2019 6:56 AM
    Moderator