Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save anonymous/2e85c0f37f15a410713d to your computer and use it in GitHub Desktop.
Save anonymous/2e85c0f37f15a410713d to your computer and use it in GitHub Desktop.
Responsive price table based on Bootstrap 3 break points
<div class="container">
<h2>Responsive price table based on Bootstrap 3 break points</h2>
</div>
<div class="container">
<div class="pricing-table">
<ul class="col-price">
<li class="header">STARTER</li>
<li class="price"><span>$10</span><i>per month</i></li>
<li>1,000 MB</li>
<li>3 Email</li>
<li>5 Databases</li>
<li>No Support</li>
<li class="get-it"><button type="button">Get it now</button></li>
</ul>
<ul class="col-price stand-out">
<li class="header">BASIC</li>
<li class="price"><span>$20</span><i>per month</i></li>
<li>5,000 MB</li>
<li>15 Email</li>
<li>10 Databases</li>
<li>Support</li>
<li class="get-it"><button type="button">Get it now</button></li>
</ul>
<ul class="col-price">
<li class="header">PROFESSIONAL</li>
<li class="price"><span>$40</span><i>per month</i></li>
<li>20,000 MB</li>
<li>50 Email</li>
<li>20 Databases</li>
<li>Support</li>
<li class="get-it"><button type="button">Get it now</button></li>
</ul>
<ul class="col-price">
<li class="header">BUSINESS</li>
<li class="price"><span>$50</span><i>per month</i></li>
<li>40,000 MB</li>
<li>75 Email</li>
<li>30 Databases</li>
<li>Support</li>
<li class="get-it"><button type="button">Get it now</button></li>
</ul>
</div>
</div>

Responsive price table based on Bootstrap 3 break points

Simple responsive price table using css3, bootstrap container width. It adapts on four container widths: fluid on mobile, 768px, 992px, 1200px.

A Pen by thingo on CodePen.

License.

* {
box-sizing: border-box;
}
/* Bootstrap container */
.container {
margin-right: auto;
margin-left: auto;
padding-left: 15px;
padding-right: 15px;
}
@media (min-width: 768px) {
.container {
width: 750px;
}
}
@media (min-width: 992px) {
.container {
width: 970px;
}
}
@media (min-width: 1200px) {
.container {
width: 1170px;
}
}
h2 {
margin: 0 auto;
text-align: center;
}
.pricing-table {
width:100%;
margin: 50px 0;
text-align: center;
font-family: Arial;
font-size: 14px;
color: #fff;
}
.pricing-table:before,
.pricing-table:after {
content: " ";
display: table;
}
.pricing-table:after {
clear: both;
}
.pricing-table {
*zoom: 1;
}
.pricing-table ul:first-child {
margin-left: 0;
}
.pricing-table ul li {
padding: 10px 20px;
}
.col-price {
list-style:none;
padding: 0;
margin: 10px 1px;
position: relative;
display: block;
float:left;
border: 1px solid #ddd;
background: #fff;
transition: all 0.2s;
}
@media (min-width: 768px){
.col-price {
width: 37.7%;
}
}
@media (min-width: 992px){
.col-price {
width: 29%;
}
}
@media (min-width: 1200px){
.col-price {
width: 24.8%;
}
}
.col-price:hover {
box-shadow: 0 0 2px 2px #00aa72;
-webkit-transform: scale(1.1,1.1);
transform: scale(1,1.1);
z-index: 1001;
cursor: pointer;
}
.col-price.stand-out {
z-index: 1000;
box-shadow: 0 0 2px 2px #00aa72;
-webkit-transform: scale(1.1,1.1);
transform: scale(1,1.1);
}
.col-price li:nth-child(2n+1) {
background: #444;
}
.col-price li:nth-child(2n) {
background: #888;
}
.col-price li.header {
color: #00aa72;
font-size: 18px;
font-weight:bold;
background: #eee;
}
.col-price li.price {
color: #333;
background: #fff;
}
.col-price .price span {
font-size: 34px;
}
.col-price li.get-it {
background: #fff;
}
button {
padding: 5px 20px;
font-size: 16px;
color: #fff;
border: 1px solid #00aa72;
box-shadow: 0 3px #009a67;
background: #00aa72;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment