How To Remove Extra Space Around the Web Part In SharePoint 2013

Ashok Raja
 
Solutions Architect
July 30, 2013
 
Rate this article
 
Views
7769

An extra padding of 20 pixel is included by default in SharePoint 2013 for every webpart. This may be inconvenient depending on the scenario how you are displaying the content in your Visual WebPart. To remove the extra space injected to the Webpart, add the below css in your .ascx file of Visual webapart. This would get rid of the extra space rendered around your webpart.

 <style type="text/css">
     .ms-webpartPage-root {
         border-spacing: 0px !important;
     }
       .ms-webpartzone-cell {
         margin: 0px !important;
     }
 </style>
Category : Tips

Author Info

Ashok Raja
 
Solutions Architect
 
Rate this article
 
I am Ashok Raja, Share Point Consultant and Architect based out of Chennai, India. ...read more
 

Leave a comment