mercredi 22 juin 2016

How do I make the containers auto adjust when I take any number of columns out html bootstrap in this example


I want to be able to modify the columns that I can insert into the html code. For some occasions there will be more than 4 columns and in other occasions there can be 3 or 2.

What I want is for this html to respond accordingly with bootstrap so that the columns take the space of the screen. If I take out one of the columns that are in this example the other don't auto adjust to the screen as if it was meant to be like this. How would I do this? where?

see in full page to get the idea... the code snippet shows when there are only 3 columns and does not auto adjust at the bottom of the full page view after running the snippet.

For now how do I do this manualy with this exact same code adding a new column or only having 3 without the auto adjust?

@import url(http://fonts.googleapis.com/css?family=Lato:100,300,400,700,900,100italic,300italic,400italic,700italic,900italic);
 body {
  background: #111d27;
  color: #111;
  min-width: 320px;
  font-size: 16px;
  font-weight: 300;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -webkit-backface-visibility: hidden;
  position: relative;
  padding: 50px 20px;
}
.pricing {
  text-align: center;
  border: 1px solid #f0f0f0;
  color: #777;
  font-size: 14px;
  padding-left: 0;
  margin-bottom: 30px;
  font-family: 'Lato';
}
.pricing img {
  display: block;
  margin: auto;
  width: 32px;
}
.pricing li:first-child,
.pricing li:last-child {
  padding: 20px 13px;
}
.pricing li {
  list-style: none;
  padding: 13px;
}
.pricing li + li {
  border-top: 1px solid #f0f0f0;
}
.pricing big {
  font-size: 32px;
}
.pricing h3 {
  margin-bottom: 0;
  font-size: 36px;
}
.pricing span {
  font-size: 12px;
  color: #999;
  font-weight: normal;
}
.pricing li:nth-last-child(2) {
  padding: 30px 13px;
}
.pricing button {
  width: auto;
  margin: auto;
  font-size: 15px;
  font-weight: bold;
  border-radius: 50px;
  color: #fff;
  padding: 9px 24px;
  background: #aaa;
  opacity: 1;
  transition: opacity .2s ease;
  border: none;
  outline: none;
}
.pricing button:hover {
  opacity: .9;
}
.pricing button:active {
  box-shadow: inset 0px 2px 2px rgba(0, 0, 0, 0.1);
}
/* pricing color */

.p-green big,
.p-green h3 {
  color: #4c7737;
}
.p-green button {
  background: #4c7737;
}
.p-yel big,
.p-yel h3 {
  color: #ffbb42;
}
.p-yel button {
  background: #ffbb42;
}
.p-red big,
.p-red h3 {
  color: #e13c4c;
}
.p-red button {
  background: #e13c4c;
}
.p-blue big,
.p-blue h3 {
  color: #3f4bb8;
}
.p-blue button {
  background: #3f4bb8;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<link href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" />




<section class="container">
  <div class="row white">
    <div class="block">

      <div class="col-xs-12 col-sm-6 col-md-3">
        <ul class="pricing p-green">
          <li>
            <img src="http://bread.pp.ua/n/settings_g.svg" alt="">
            <big>Start</big>
          </li>
          <li>Responsive Design</li>
          <li>Color Customization</li>
          <li>HTML5 & CSS3</li>
          <li>Styled elements</li>
          <li>
            <h3>$199</h3>
            <span>per month</span>
          </li>
          <li>
            <button>Join Now</button>
          </li>
        </ul>
      </div>

      <div class="col-xs-12 col-sm-6 col-md-3">
        <ul class="pricing p-yel">
          <li>
            <img src="http://bread.pp.ua/n/settings_y.svg" alt="">
            <big>Good</big>
          </li>
          <li>Responsive Design</li>
          <li>Color Customization</li>
          <li>HTML5 & CSS3</li>
          <li>Styled elements</li>
          <li>
            <h3>$299</h3>
            <span>per month</span>
          </li>
          <li>
            <button>Join Now</button>
          </li>
        </ul>
      </div>

      <div class="col-xs-12 col-sm-6 col-md-3">
        <ul class="pricing p-red">
          <li>
            <img src="http://bread.pp.ua/n/settings_r.svg" alt="">
            <big>Ultima</big>
          </li>
          <li>Responsive Design</li>
          <li>Color Customization</li>
          <li>HTML5 & CSS3</li>
          <li>Styled elements</li>
          <li>
            <h3>$399</h3>
            <span>per month</span>
          </li>
          <li>
            <button>Join Now</button>
          </li>
        </ul>
      </div>

      <div class="col-xs-12 col-sm-6 col-md-3">
        <ul class="pricing p-blue">
          <li>
            <img src="http://bread.pp.ua/n/settings_b.svg" alt="">
            <big>Vip</big>
          </li>
          <li>Responsive Design</li>
          <li>Color Customization</li>
          <li>HTML5 & CSS3</li>
          <li>Styled elements</li>
          <li>
            <h3>$799</h3>
            <span>per month</span>
          </li>
          <li>
            <button>Join Now</button>
          </li>
        </ul>
      </div>


    </div>
    <!-- /block -->
  </div>
  <!-- /row -->
</section>
<br/>
<section class="container">
  <div class="row white">
    <div class="block">

      <div class="col-xs-12 col-sm-6 col-md-3">
        <ul class="pricing p-green">
          <li>
            <img src="http://bread.pp.ua/n/settings_g.svg" alt="">
            <big>Start</big>
          </li>
          <li>Responsive Design</li>
          <li>Color Customization</li>
          <li>HTML5 & CSS3</li>
          <li>Styled elements</li>
          <li>
            <h3>$199</h3>
            <span>per month</span>
          </li>
          <li>
            <button>Join Now</button>
          </li>
        </ul>
      </div>

      <div class="col-xs-12 col-sm-6 col-md-3">
        <ul class="pricing p-yel">
          <li>
            <img src="http://bread.pp.ua/n/settings_y.svg" alt="">
            <big>Good</big>
          </li>
          <li>Responsive Design</li>
          <li>Color Customization</li>
          <li>HTML5 & CSS3</li>
          <li>Styled elements</li>
          <li>
            <h3>$299</h3>
            <span>per month</span>
          </li>
          <li>
            <button>Join Now</button>
          </li>
        </ul>
      </div>

      <div class="col-xs-12 col-sm-6 col-md-3">
        <ul class="pricing p-red">
          <li>
            <img src="http://bread.pp.ua/n/settings_r.svg" alt="">
            <big>Ultima</big>
          </li>
          <li>Responsive Design</li>
          <li>Color Customization</li>
          <li>HTML5 & CSS3</li>
          <li>Styled elements</li>
          <li>
            <h3>$399</h3>
            <span>per month</span>
          </li>
          <li>
            <button>Join Now</button>
          </li>
        </ul>
      </div>



    </div>
    <!-- /block -->
  </div>
  <!-- /row -->
</section>

Aucun commentaire:

Enregistrer un commentaire