Fixed width, centered design in SharePoint site using css

By default SharePoint gives 100% width to sites created. We can fixed width of site by using custom css and changing some class names
in master page.

Lets have look to the solution.

div.s4-title.s4-lp, body #s4-mainarea, #s4-topheader2, #s4-statusbarcontainer
{
width: 960px;
margin: auto;
padding: 0px;
float: none;
background-image: none;
background-color: white;
}

To get fixed width design add css classes to the following element.

Default

<div id="s4-workspace">

Fixed Width

<div id="s4-workspace">

Default

<div id="s4-titlerow" class="s4-pr s4-notdlg s4-titlerowhidetitle">

Fixed Width

<div id="s4-titlerow"  class="s4-pr s4-notdlg s4-titlerowhidetitle s4-nosetwidth">

Fixed width, centered design in SharePoint site using css

Published by

Mandar Badve

Microsoft web, cloud, mobile developer

Leave a Reply

Your email address will not be published. Required fields are marked *