Sunday, February 12, 2012

Centered layout with CSS & v4.master

When customizing SharePoint 2010 Master Page with a static width, you often want to center the content of the page.
Here is the CSS for centering the contents in the ribbon container and letting the container it behave as designed:
#s4-ribbonrow > #s4-ribboncont > #RibbonContainer > #Ribbon > .ms-cui-ribbonTopBars > div {
width: 990px;
margin: 0 auto;
float: none;
}

#s4-ribbonrow > #s4-ribboncont > #RibbonContainer > #Ribbon > .ms-cui-ribbonTopBars > div,
#s4-bodyContainer > div,
body #s4-titlerow > div
{
width: 990px;
margin: 0 auto;
float: none;
}

read more at:

No comments:

Post a Comment