locked
How to link my own css and js in sharepoint 2013 MasterPage.html RRS feed

  • Question

  • Hi Team,

    I'm trying to add my css and js file in my sharepoint 2013 SeattleMaster.html. like this:

    <link href="css/bootstrap-theme.min.css" type="text/css" rel="stylesheet"> and

     <script src="js/jquery.js" type="text/javascript"/>

    but scripts and css are not getting rendered in page. can you please suggest?

    Thanks and Regards

    xserks

    Tuesday, June 3, 2014 9:26 AM

Answers

  • Hi xserks,

    Where you have the scipts?

    If you have the scripts and css on library Please give url like below,

    <link href="/sitename/libraryname/css/bootstrap-theme.min.css" type="text/css" rel="stylesheet"> and

     <script src="/sitename/libraryname/js/jquery.js" type="text/javascript"/>

    If you have scripts on Layouts folder give like below

    <link href="/_layouts/15/Modulename/css/bootstrap-theme.min.css" type="text/css" rel="stylesheet"> and

     <script src="/_layouts/15/Modulename/js/jquery.js" type="text/javascript"/>

    Thanks,

    Kaviya

    • Proposed as answer by KaviyaMVP Tuesday, June 3, 2014 1:13 PM
    • Marked as answer by Dennis Guo Sunday, June 15, 2014 1:30 PM
    Tuesday, June 3, 2014 10:10 AM

All replies

  • Hello xserks,

    Please use cssRegistration tag to inject your css

    http://www.ashokraja.me/post/Refer-Scripts-and-CSS-Style-Sheet-in-SharePoint-2013-Visual-Web-Part-and-Master-Page.aspx


    Please remember to click 'Mark as Answer' on the answer if it helps you

    Tuesday, June 3, 2014 9:51 AM
  • Hi xserks,

    Where you have the scipts?

    If you have the scripts and css on library Please give url like below,

    <link href="/sitename/libraryname/css/bootstrap-theme.min.css" type="text/css" rel="stylesheet"> and

     <script src="/sitename/libraryname/js/jquery.js" type="text/javascript"/>

    If you have scripts on Layouts folder give like below

    <link href="/_layouts/15/Modulename/css/bootstrap-theme.min.css" type="text/css" rel="stylesheet"> and

     <script src="/_layouts/15/Modulename/js/jquery.js" type="text/javascript"/>

    Thanks,

    Kaviya

    • Proposed as answer by KaviyaMVP Tuesday, June 3, 2014 1:13 PM
    • Marked as answer by Dennis Guo Sunday, June 15, 2014 1:30 PM
    Tuesday, June 3, 2014 10:10 AM