html - Whitespace being generated when screen is resized -


i have html file structured in following manner:

.container-fluid {    height: 100%;    width: 100%;    background: white;    margin: 0px;  }    .double-panel {    width: 50%;    height: 66%;    background-color: #999;    float: left;    min-width: 300px;    border: thick solid white;  }    .panel {    width: 50%;    height: 33%;    background-color: #555;    float: left;    min-width: 300px;    box-sizing: border-box;    -moz-box-sizing: border-box;    -webkit-box-sizing: border-box;    border: thick solid white;  }    .bord {    float: right;    margin: 0;    padding: 0;    width: inherit;    height: 100%;  }    .fields {    background-color: #ccc;  }
<div class="container-fluid">    <div id="main" class="double-panel">      <div class="textbox col-6" id="wwd">        <h4>what do</h4>        <button>current vacancies</button>        <ul>          <li>facebook</li>          <li>linkedin</li>          <li>twitter</li>        </ul>      </div>    </div>      <div id="salesrecur" class="panel">      <div class="col-6 bord"></div>      <div class="col-6 fields bord">        <h4></h4>        <h2></h2>      </div>    </div>      <div class="panel" id="soft">      <div class="col-6 bord"></div>      <div class="col-6 fields bord">        <h4></h4>        <h2></h2>      </div>    </div>    <div id="salesrecur" class="panel">      <div class="col-6 bord"></div>      <div class="col-6 fields bord">        <h4></h4>        <h2></h2>      </div>    </div>    <div class="panel" id="soft">      <div class="col-6 bord"></div>      <div class="col-6 fields bord">      </div>    </div>  </div>

when resize window sizes, 1 of boxes has width of 50%, pushed down whitespace , structure lost. peculiar occurs @ certain, specific sizes.

my question why resizing occur, , how prevent happening?

the width of boxes more 50%. border calculated on top of width default in css each div more 50% + 10px.

this called box model.

you can change way box model works setting:

box-sizing: border-box;

this include padding , borders in width set

note: i've noticed have on .panel , after reading issue again it's min-width you've set on panels


Comments

Popular posts from this blog

PHP and MySQL WP -

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

go - golang pprof for c library code -