在特定的SharePoint功能区栏按钮上应用CSS?

Jim*_*ker 2 css sharepoint jquery ribbon sharepoint-2010

有没有办法简单地隐藏特定的SharePoint功能区栏按钮?我看到了用于隐藏整个功能区栏的CSS代码,但我只想在其上隐藏1个按钮(签到按钮).我尝试过几种方式引用它,例如:

a#Ribbon.DocLibListForm.Edit.Commit.CheckIn-Large { display: none; !important }

ms-cui-ctl-large#Ribbon.DocLibListForm.Edit.Commit.CheckIn-Large { display: none; !important }

a.ms-cui-ctl-large#Ribbon.DocLibListForm.Edit.Commit.CheckIn-Large { display: none; !important }
Run Code Online (Sandbox Code Playgroud)

我的CSS可能是完全错误的,或者我可能会以错误的方式解决它.我怎么能隐藏这个元素?

小智 6

通过http://online.appdev.com/edge/blogs/doug_ware/archive/2011/08/02/hiding-a-sharepoint-ribbon-button-with-css.aspx找到了解决这个问题的方法.

诀窍在于,对于'.'SharePoint ID中的任何内容(其中包含.作为其名称的一部分并且不可编辑),您需要在每个之前使用'\','\.'在原始示例中,您将发现:

#Ribbon\.DocLibListForm\.Edit\.Commit\.CheckIn-Large {display:none;}
Run Code Online (Sandbox Code Playgroud)

奇迹般有效!:-)