Question

I would like to hide the menu item in a document library that reads "Approve/Reject": enter image description here

Since approval is being managed by a workflow that I created. Most online articles tell the solution to this issue is adding custom CSS to the page so I am trying this method. I have opened the page ~/AllItems.aspx in SharePoint Designer.

Upon inspecting the HTML for the page in my browser, I found the html for that button:

enter image description here

I tried editing AllItems.aspx as follows but the button would not disappear:

enter image description here

Can someone please give a full, working explanation of how I might achieve hiding this button?

Was it helpful?

Solution

You have a small typo in that css. Either try

<style type="text/css">
 button[name="Approve/Reject"] > div > span {
  display: none;
}
</style>

or

<style type="text/css">
 button[name="Approve/Reject"] span {
  display: none;
}
</style>

The reason why your css rule doesnt work is because you are targeting span right under the next sibling level of a button element, but the span shown in your html example is nested under a deeper level.

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top