How to create: Responsive Pricing Table
- Previous Page Resize Header on Scroll
- Next Page Parallax Scrolling
Learn how to create a responsive pricing table using CSS.
How to create a responsive pricing table
Step 1 - Add HTML:
<div class="columns"> <ul class="price"> <li class="header">Basic</li> <li class="grey">$ 9.99 / year</li> <li>10GB Storage</li> <li>10 Emails</li> <li>10 Domains</li> <li>1GB Bandwidth</li> <li class="grey"><a href="#" class="button">Sign Up</a></li> </ul> </div>
Second step - Add CSS:
* { box-sizing: border-box; } /* Create three equal-width columns */ .columns { float: left; width: 33.3%; padding: 8px; } /* Set the style of the list */ .price { list-style-type: none; border: 1px solid #eee; margin: 0; padding: 0; -webkit-transition: 0.3s; transition: 0.3s; } /* Add shadow when the mouse hovers */ .price:hover { box-shadow: 0 8px 12px 0 rgba(0,0,0,0.2) } /* Pricing table header */ .price .header { background-color: #111; color: white; font-size: 25px; } /* List item */ .price li { border-bottom: 1px solid #eee; padding: 20px; text-align: center; } /* Color list item */ .price .grey { background-color: #eee; font-size: 20px; } /* "Sign Up" button */ .button { background-color: #04AA6D; border: none; color: white; padding: 10px 25px; text-align: center; text-decoration: none; font-size: 18px; } /* When the screen width is less than 600px, change the width of the three columns to 100% (to stack on small screens) */ @media only screen and (max-width: 600px) { .columns { width: 100%; } }
- Previous Page Resize Header on Scroll
- Next Page Parallax Scrolling