2

Does anyone know how to reduce the space above the ribbon in the standard SharePoint 2010 masterpage (see image below)

There are a bunch of assorted classes and divs all over the place, but none seem to explicitly set the height (or even a min-height), it looks to be governed by something else.

Anyone else had luck with this?

enter image description here

4 Answers 4

3

I can see why you're trying to remove the "white space". BUT, this is no white space. It's used by the Ribbon for the contextual tab groups, so I do not recommend that you get rid of it! What's the reason to hide it?

1
  • ... well spotted, I hadn't thought of that. Now I've a good reason to tell the client why not to reduce it. Cheers :)
    – James Love
    May 29, 2011 at 9:45
1

I don't have the details available right now, but there are scripts which drive much of the top of the SharePoint 2010 screen. Those scripts regularly reset various attributes of elements to keep them sized and behaving certain ways. This means that you need to understand not just the CSS which is applied, but also the script which operates on the elements.

3
  • Spot on, there's also the risk that if you're letting SharePoint manage your scrolling, adding something like a negative top margin on the body may affect the way that script calculates the scrolling.
    – webdes03
    Oct 7, 2011 at 14:17
  • That's a fair point, actually. I assumed doing something simple like a negative top margin would avoid messing around with all the different classes actually inside the ribbon, but it may well affect something more fundamental. (It does seem to work, though!)
    – Rawling
    Oct 7, 2011 at 14:21
  • Obviously I haven't tested it, but I believe the script that handles the scrolling looks at the height of the body against the other baseline elements. I "believe" IE ignores anything that's a negative margin outside the body, but other standards compliant browsers may not. I just assumed it would be inconsistent or inaccurate in different browsers, but as I said, I haven't tested it.
    – webdes03
    Oct 7, 2011 at 14:46
1

@jimmywim http://platinumdogs.wordpress.com/2011/12/16/sharepoint-2010-reducing-the-space-above-the-ribbon/

1
0

Just add body{margin-top: -19px;} to your CSS somewhere. That pushes much of the blank space past the top of the viewport - including the title of each contextual tab group, but leaving enough to tell that the tabs are grouped.

You may also need something like .ms-cui-TabRowRight{margin-top:19px;} - I know I did, but my tabrowright was quite heavily customised.

(This is kinda meant as a joke answer, but if you really want to reduce the height the ribbon eats this is a quick and easy (and did I mention horrible and dirty?) way to save 19px.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.