Bootstrap panel unwanted right and left margins on smaller sizes -


i created panel using bootstrap , codes below:

<section class="container-fluid" id="stats"> <div class="panel panel-default col-md-6">     <div class="panel-heading">         <i class="fa fa-bar-chart fa-lg"></i>         <strong>statistics</strong>     </div>     <div class="panel-body">         ...     </div> </div> </section> 

but output have gap left , right in panel heading.
enter image description here

if remove col-md-6, problem became solved. need have 6 cols.
please me ...

edit: can take @ sample
http://codepen.io/mbsmt/pen/enxmoy

you have padding on left , right because default bootstrap adds gutter padding columns. gutter width 15px. here's mixin creates .col-md- classes:

// located within less/variables.less //** padding between columns. gets divided in half left , right. @grid-gutter-width: 30px;  // located within less/mixins/grid.less .make-md-column(@columns; @gutter: @grid-gutter-width) {   position: relative;   min-height: 1px;   padding-left:  (@gutter / 2);   padding-right: (@gutter / 2); } 

to remove padding, have 2 options:

  1. change default padding 0px. cause larger problems though effect column layouts.
  2. create custom css layout code targeting specific panel such #stats > .panel.col-md-6. i've supplied example below doing this.

#stats > .panel.col-md-6 {    padding-left: 0;    padding-right: 0;  }
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet" />  <link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" />    <section class="container-fluid" id="stats">    <div class="panel panel-default col-md-6">      <div class="panel-heading">        <i class="fa fa-bar-chart fa-lg"></i>        <strong>statistics</strong>      </div>      <div class="panel-body">        ...      </div>    </div>  </section>


Comments

Popular posts from this blog

yii2 - Yii 2 Running a Cron in the basic template -

asp.net - 'System.Web.HttpContext' does not contain a definition for 'GetOwinContext' Mystery -

mercurial graft feature, can it copy? -