Jquery – Apply CSS on a Specific SharePoint Ribbon Bar Button

cssjqueryribbonsharepointsharepoint-2010

Is there a way to simply hide a particular SharePoint ribbon bar button? I've see the CSS code for hiding the entire ribbon bar, but I only want to hide 1 button on it (the check-in button). I've tried referencing it several ways, such as:

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 }

It's possible that my CSS is just all wrong, or perhaps I'm going about it the wrong way. How can I hide this element?

Best Answer

Found the solution to this solely via CSS thanks to http://online.appdev.com/edge/blogs/doug_ware/archive/2011/08/02/hiding-a-sharepoint-ribbon-button-with-css.aspx

The trick is that for any '.' within the SharePoint ID (Which do unfortuenately include . as part of their names and are non-editable) you need to preceed each with '\' to become '\.' so in your original example you'll find that:

#Ribbon\.DocLibListForm\.Edit\.Commit\.CheckIn-Large {display:none;}

Works like a charm! :-)