Pages

Tuesday, December 7, 2010

SharePoint Designer 2010: Fix the Width of a Master Page

Hello Friends,

We can add an embedded style sheet that will fix the width of pages inheriting from this master page. Let us look at step by step procedure.

1. Open a your sharepoint site in SharePoint Designer 2010.
2. Select the Master Pages section of Site Objects.
3. Create a new master page,name it mycustom.master.
4. Right-click on the file and select “Set as Default Master Page.”
5. Right click on the file and select “Edit File in Advanced Mode.”
Add the following embedded style sheet into the master page just before the closing </head> tag:
<style type=”text/css”>
/*fixed width */
#s4-workspace > div,#s4-bodyContainer > div,body #s4-titlerow > div{
width:1000px;
margin:0 auto;
float:none;
padding:0;
}
body #s4-mainarea{
/*make main area have background of white and add a border */
background:#fff;
border:1px solid #ddd;
border-top:0px;
min-height:580px;
/*contain content in all browsers but IE7 */
display:table;
}
/*add padding back to title table*/
.s4-title-inner{
padding:0 0 0 5px;
}
/*background color of site*/
#s4-workspace {
background:#efefef /*none*/;
}
/*body container */
#s4-bodyContainer{
position:relative;
width:100%;
}
/*fix overhanging tables*/
.ms-v4propertysheetspacing
{margin:0;}
</style>
6. Save and check in your changes.

Check the width has been changed!!!

Hope this helps!!!

Disha Shah

2 comments:

  1. Thank you - I had an issue with
    s4-titletable
    and I could not fix the problem of the table sticking out by 5 pixels above the body of the page. Ah, but you are clever than me and fixed it !

    fantastic !!!

    Hope all is well with you - Hugh

    ReplyDelete
  2. This comment has been removed by a blog administrator.

    ReplyDelete