Sunday, May 17, 2015

Creating center positioned Master Page layout using CSS in SharePoint 2013

If we want to create a master page layout with all the contents or layouts center aligned . The simplest CSS trick which we can do is below:

Just add the below CSS in the your CSS file:

#s4-bodyContainer {padding-bottom: 0 !important; margin-left: 50px;
    margin-right: 50px; }
div.s4-title.s4-lp,
 body #s4-mainarea,
 #s4-topheader2,
 #s4-statusbarcontainer{
     margin: 50px;
     padding: 0px;
     float: none;
     background-image: none;
     background-color: white;
}


Also change the "s4-workspace" div like below:

<div id="s4-workspace" class="s4-nosetwidth">
...........

</div>


That is it ..  You are done !!!. :-)

No comments:

Post a Comment