1

I have a css to hide list search box on document libraries. It's in the SiteAssets library.

I can edit a document library view and add Content Editor webpart and add css reference and able to hide.

However, I added following code to masterterpage after core.css but it doesn't fire. Any idea why?

<SharePoint:CssRegistration name="<% $SPUrl:~SiteCollection/SiteAssets/hideSearchBox.css%>" runat="server"  After="corev15.css" />

The css is 

<style>
.ms-inlinesearch-divbaseline{ display: none !important;}
</style>
  • if your css is in an external file, why do you have the style tags? – Tiago Duarte Jul 2 '15 at 13:43
0

You need to enable publishing features on the site collection (SP_Site) and on the web (SP_Web) and set the alternate CSS URL to your css-file.

  1. Find "Site Collection Features" setting and enable all features with name "publishing" in it.
  2. Find "Manage Site Features" setting and enable all feature with name "publishing" in it.
  3. Find "Master Page" setting link under "Look and Feel".
  4. Click "Alternate CSS URL". This is where you apply your own CSS file.
  5. Upload a CSS file to any document library. Ideally to "Style Library".
  6. Go to step 4 and choose your uploaded CSS file.

Source: Most upvoted answer to the question "CSS and master page - Sharepoint online - Office 365"

0

If you are trying to add in the HTML page (ex: seattle.html) then use the below code

<!--MS:
<style type="text/css">-->
  .ms-inlinesearch-divbaseline{ display: none !important;}
<!--ME: </style>-->

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.