Reasons for a centered design
There are certain reasons for a centered or fixed width design. By default SharePoint scales the complete page to 100% of the screen. When it comes to web content management where the design is more text driven and collaboration concerns are not that much relevant. When the content gets wider and wider with the screen resolution the lines of a text gets longer and longer. The content then will be harder to read.
Fixed width looks pretty but mostly makes only sense when it public facing web sites should be created. The reason is that you don’t know what the users screen resolution is. Nowadays the most common design requires supporting a minimal resolution 1024px or maybe sometimes 1280px. To be on the save side most web designer use grid systems like 960.gs which implements width of 980px and is optimized for a minimal screen resolution for 1024 by 786.
Fixed design could also be used for blogs and maybe wikis. On a collaboration perspective a 100% width makes more sense. So comment and let me know if you think different.
Centered Design in SharePoint
As I said before most of the tutorials available on the web don’t respect the ribbon and stuff it into a design that has a fixed width. The fastest way to get a fixed width design I found needs only the following CSS code and is flexible to be changed to any desired width.
To get the fixed width design working with the v4.master some classes needs to be added.
Needs to be changed to:
<div class="s4-nosetwidth" id="s4-workspace">
And the second html element needs to be altered:
<div class="s4-pr s4-notdlg s4-titlerowhidetitle" id="s4-titlerow">
This need to be changed to:
<div class="s4-pr s4-notdlg s4-titlerowhidetitle s4-nosetwidth" id="s4-titlerow">
By adding the s4-nosetwidth style class SharePoint won’t assign the inline style property for width and the design stay centered. The result looks like this:
At the end the design of SharePoint is centered. When any page will be edited the Ribbon will still remain on the whole width of the browser. It’s much more comfortable to edit SharePoint that way.
The size of the design could be changed to any size just by simply modify the width property. Remember always respect the size of the ribbon and let it live outside your design for easy editing.