Hide the Approve/Reject button in AllItems.aspx in SharePoint Online
-
08-02-2021 - |
문제
I would like to hide the menu item in a document library that reads "Approve/Reject":
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:
I tried editing AllItems.aspx
as follows but the button would not disappear:
Can someone please give a full, working explanation of how I might achieve hiding this button?
해결책
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.