No Scrollbar when we security trims SharePoint 2010 ribbon


  • We have a portal in SharePoint 2010. We had a requirement to hide sharepoint 2010 ribbon for lower level users. We make use of the security trim control in master page and achieved it. Now ribbon is available only for the higher level users. But this comes with an issue, when sharepoint trims the Ribbon based on a prvilege, it removes the scrollbars too. Now the common users of our portal not able to navigate to the bottom portion of our site pages.

    Is there any quick fix for this issue?

    Or is there any other way to hide ribbon for the common users in SharePoint 2010?


    Thanks in advance



    Wednesday, July 14, 2010 3:17 AM

All replies

  • I am having this exact same issue, did you ever find a work around without having to change the syles on the corev4.css?
    Wednesday, July 28, 2010 1:07 PM
  • SharePoint also controls the scroll. What you need to probably do is unlock the ribbon. I accomplished this on my site by doing the following:

    rename the ID=s4-workspace to anything else , & remove the scroll portion to <body scroll=no


    Heres is some further guidance,

    Wednesday, July 28, 2010 6:27 PM
  • I found that this blog  entry( was very helpful when I had this same issue. Although there was a typo in the code provided.

    In step 4 use this code:

    <Sharepoint:SPSecurityTrimmedControl ID="SPSecurityTrimmedControl2" runat="server" PermissionsString="AddAndCustomizePages">
        <script type="text/javascript">
            document.getElementById("s4-ribbonrow").style.display = "block";

    Wednesday, July 28, 2010 7:25 PM
  • Wednesday, November 03, 2010 8:44 AM
  • Hi,


    Just drop this code on your master page (you can change Permissions attribute by your way). Scroll bar will stay on the pages for any user.



    MSTS, SharePoint tips blog:
    • Proposed as answer by Stefan BauerMVP Wednesday, November 03, 2010 8:16 PM
    Wednesday, November 03, 2010 5:44 PM
  • Instead of placing the SecurityTrimmed control around the entire ribbon, place it just inside the s4-ribbonrow DIV.  You'll also need a bit of CSS to hide the ribbon when it should not appear:

    body #s4-ribbonrow {
      min-height: 0 !important;
      height: auto !important;
    For more info., follow the guide in my blog post, here:
    Thursday, January 20, 2011 3:22 PM
  • SharePoint No Scroll Bar


    A few users and I had run into the problem of not having a scroll bar when customizing our master pages on SharePoint. This can be annoying at times when using SharePoint and not having a scroll bar.


    Here is what we have come up with.


    You need to add:

    < div id=”s4-workspace” >

    < div id=”s4-bodyContainer” >

    around the main body content.


    Make sure body tag contains “scroll=no”

    The style sheet defines the div tags to scroll.

    It also used those div tags to calculate the size of the dialog boxes.

    The dialog boxes use the “class=’notdlg’” to determine what not to show.


    The process is pretty self explanatory and you can view the finished product on our website.


    Shawn Zernik

    Tuesday, June 07, 2011 7:53 PM
  • Use the security trim control inside a JQuery statement. just make sure you comment out the control - it still works while commented out.

    <script type="text/javascript">
    			hideRibbon = true;
    				//<Sharepoint:SPSecurityTrimmedControl runat="server" PermissionsString="AddAndCustomizePages">
    				hideRibbon = false;
    				if (hideRibbon){

    ribbonrow is a div tag I use to wrap the ribbon. This also allows me to set it to fixed width.

    Brian T. Shell
    Wednesday, June 08, 2011 1:12 AM
  • Hi Subessh,

    need to add following code in custom css, just found same issue

    while working on sharepoint 2013, please let me know if you have

    any other approach.

    /*hidden Scrollbar issue*/ /* fix scrolling on list pages */ #s4-bodyContainer {} /* hide body scrolling (SharePoint will handle) */ body { }


    Nikhil Singh

    Thanks, ShankarSingh

    Monday, September 30, 2013 4:26 PM
  • Best solution for me was 

    In the Header of the master page 


    <style type="text/css">
    #s4-ribbonrow{display: none;}


    In the body of the master page in a SecurityTrimmed div (for the users i want to see ribbon   )



    <script type="text/javascript">




    Thursday, October 24, 2013 12:47 PM