The following is an example of the CSS style to create a pricing table to show hosting plans.
CSS Pricing Table Example
Put the following CSS in the <head> section of the HTML. You can change the colors for the header border and signup buttons for a class named plan1, plan2, etc. For example, change the color for class (.plan2) for Professional pricing tab.
CSS for <head>
<style> #fox-pricing-table { margin: 0 auto; text-align: center; width: 928px; /* total computed width */ zoom: 1; } #fox-pricing-table:before, #fox-pricing-table:after { content: ""; display: table } #fox-pricing-table:after { clear: both } /* --------------- */ #fox-pricing-table .plan { font: 13px 'Lucida Sans', 'trebuchet MS', Arial, Helvetica; background: #fff; border: 1px solid #ddd; color: #333; padding: 20px; width: 180px; float: left; _display: inline; /* IE6 double margin fix */ position: relative; margin: 0 5px; -moz-box-shadow: 0 2px 2px -1px rgba(0, 0, 0, .3); -webkit-box-shadow: 0 2px 2px -1px rgba(0, 0, 0, .3); box-shadow: 0 2px 2px -1px rgba(0, 0, 0, .3); } #fox-pricing-table .plan:after { z-index: -1; position: absolute; content: ""; bottom: 10px; right: 4px; width: 80%; top: 80%; -webkit-box-shadow: 0 12px 5px rgba(0, 0, 0, .3); -moz-box-shadow: 0 12px 5px rgba(0, 0, 0, .3); box-shadow: 0 12px 5px rgba(0, 0, 0, .3); -webkit-transform: rotate(3deg); -moz-transform: rotate(3deg); -o-transform: rotate(3deg); -ms-transform: rotate(3deg); transform: rotate(3deg); } #fox-pricing-table .popular-plan { top: -20px; padding: 40px 20px; } /* --------------- */ #fox-pricing-table .header { position: relative; font-size: 20px; font-weight: normal; text-transform: uppercase; padding: 40px; margin: -20px -20px 20px -20px; border-bottom: 8px solid; background-color: #eee; background-image: -moz-linear-gradient(#fff, #eee); background-image: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#eee)); background-image: -webkit-linear-gradient(#fff, #eee); background-image: -o-linear-gradient(#fff, #eee); background-image: -ms-linear-gradient(#fff, #eee); background-image: linear-gradient(#fff, #eee); } #fox-pricing-table .header:after { position: absolute; bottom: -8px; left: 0; height: 3px; width: 100%; content: ''; background-image: url(images/bar.png); } #fox-pricing-table .popular-plan .header { margin-top: -40px; padding-top: 60px; } #fox-pricing-table .plan1 .header { border-bottom-color: #B3E03F; } #fox-pricing-table .plan2 .header { border-bottom-color: #f36347; } #fox-pricing-table .plan3 .header { border-bottom-color: #85bf31; } #fox-pricing-table .plan4 .header { border-bottom-color: #45D0DA; } /* --------------- */ #fox-pricing-table .price { font-size: 45px; } #fox-pricing-table .monthly { font-size: 13px; margin-bottom: 20px; text-transform: uppercase; color: #999; } /* --------------- */ #fox-pricing-table ul { margin: 20px 0; padding: 0; list-style: none; } #fox-pricing-table li { padding: 10px 0; } /* --------------- */ #fox-pricing-table .signup { position: relative; padding: 10px 20px; color: #fff; font: bold 14px Arial, Helvetica; text-transform: uppercase; text-decoration: none; display: inline-block; background-color: #72ce3f; -moz-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; text-shadow: 0 -1px 0 rgba(0, 0, 0, .15); opacity: .9; } #fox-pricing-table .signup:hover { opacity: 1; } #fox-pricing-table .signup:active { -moz-box-shadow: 0 2px 2px rgba(0, 0, 0, .3) inset; -webkit-box-shadow: 0 2px 2px rgba(0, 0, 0, .3) inset; box-shadow: 0 2px 2px rgba(0, 0, 0, .3) inset; } #fox-pricing-table .plan1 .signup { background: #B3E03F; } #fox-pricing-table .plan2 .signup { background: #f36347; } #fox-pricing-table .plan3 .signup { background: #85bf31; } #fox-pricing-table .plan4 .signup { background: #45D0DA; } </style>
Put the following HTML in the <body> section of the HTML page. You can easily identify the demo data inside the table, change it according to your need.
HTML for <body>
<div class="container1"> <!-- foxpricing top bar --> <header> <h1>CSS For Pricing Table</h1> </header> <!-- start header here--> <header> <div id="fox-pricing-table"> <div class="plan plan1"> <div class="header">Enterprise</div> <div class="price">$99</div> <div class="monthly">per month</div> <ul> <li><b>20GB</b> Disk Space</li> <li><b>1000GB</b> Monthly Bandwidth</li> <li><b>30</b> Email Accounts</li> <li><b>Unlimited</b> subdomains</li> </ul> <a class="signup" href="#">Sign up</a> </div> <div class="plan plan2 popular-plan"> <div class="header">Professional</div> <div class="price">$49</div> <div class="monthly">per month</div> <ul> <li><b>10GB</b> Disk Space</li> <li><b>500GB</b> Monthly Bandwidth</li> <li><b>15</b> Email Accounts</li> <li><b>Unlimited</b> subdomains</li> </ul> <a class="signup" href="#">Sign up</a> </div> <div class="plan plan3"> <div class="header">Standard</div> <div class="price">$29</div> <div class="monthly">per month</div> <ul> <li><b>5GB</b> Disk Space</li> <li><b>250GB</b> Monthly Bandwidth</li> <li><b>5</b> Email Accounts</li> <li><b>Unlimited</b> subdomains</li> </ul> <a class="signup" href="#">Sign up</a> </div> <div class="plan plan4"> <div class="header">Basic</div> <div class="price">$19</div> <div class="monthly">per month</div> <ul> <li><b>2.5GB</b> Disk Space</li> <li><b>150GB</b> Monthly Bandwidth</li> <li><b>1</b> Email Accounts</li> <li><b>Unlimited</b> subdomains</li> </ul> <a class="signup" href="#">Sign up</a> </div> </div> </header> <!-- end header --> </div>
Output
Hosting Plans Demo
Enterprise
$99
per month
- 20GB Disk Space
- 1000GB Monthly Bandwidth
- 30 Email Accounts
- Unlimited subdomains
Professional
$49
per month
- 10GB Disk Space
- 500GB Monthly Bandwidth
- 15 Email Accounts
- Unlimited subdomains
Standard
$29
per month
- 5GB Disk Space
- 250GB Monthly Bandwidth
- 5 Email Accounts
- Unlimited subdomains
Full HTML and CSS Example
<!DOCTYPE html> <html> <head> <title>CSS For Pricing Table</title> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no" /> <style> #fox-pricing-table { margin: 0 auto; text-align: center; width: 928px; /* total computed width */ zoom: 1; } #fox-pricing-table:before, #fox-pricing-table:after { content: ""; display: table } #fox-pricing-table:after { clear: both } /* --------------- */ #fox-pricing-table .plan { font: 13px 'Lucida Sans', 'trebuchet MS', Arial, Helvetica; background: #fff; border: 1px solid #ddd; color: #333; padding: 20px; width: 180px; float: left; _display: inline; /* IE6 double margin fix */ position: relative; margin: 0 5px; -moz-box-shadow: 0 2px 2px -1px rgba(0, 0, 0, .3); -webkit-box-shadow: 0 2px 2px -1px rgba(0, 0, 0, .3); box-shadow: 0 2px 2px -1px rgba(0, 0, 0, .3); } #fox-pricing-table .plan:after { z-index: -1; position: absolute; content: ""; bottom: 10px; right: 4px; width: 80%; top: 80%; -webkit-box-shadow: 0 12px 5px rgba(0, 0, 0, .3); -moz-box-shadow: 0 12px 5px rgba(0, 0, 0, .3); box-shadow: 0 12px 5px rgba(0, 0, 0, .3); -webkit-transform: rotate(3deg); -moz-transform: rotate(3deg); -o-transform: rotate(3deg); -ms-transform: rotate(3deg); transform: rotate(3deg); } #fox-pricing-table .popular-plan { top: -20px; padding: 40px 20px; } /* --------------- */ #fox-pricing-table .header { position: relative; font-size: 18px; font-weight: normal; text-transform: uppercase; padding: 40px; margin: -20px -20px 20px -20px; border-bottom: 8px solid; background-color: #eee; background-image: -moz-linear-gradient(#fff, #eee); background-image: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#eee)); background-image: -webkit-linear-gradient(#fff, #eee); background-image: -o-linear-gradient(#fff, #eee); background-image: -ms-linear-gradient(#fff, #eee); background-image: linear-gradient(#fff, #eee); } #fox-pricing-table .header:after { position: absolute; bottom: -8px; left: 0; height: 3px; width: 100%; content: ''; background-image: url(images/bar.png); } #fox-pricing-table .popular-plan .header { margin-top: -40px; padding-top: 60px; } #fox-pricing-table .plan1 .header { border-bottom-color: #B3E03F; } #fox-pricing-table .plan2 .header { border-bottom-color: #f36347; } #fox-pricing-table .plan3 .header { border-bottom-color: #85bf31; } #fox-pricing-table .plan4 .header { border-bottom-color: #45D0DA; } /* --------------- */ #fox-pricing-table .price { font-size: 45px; } #fox-pricing-table .monthly { font-size: 13px; margin-bottom: 20px; text-transform: uppercase; color: #999; } /* --------------- */ #fox-pricing-table ul { margin: 18px 0; padding: 0; list-style: none; } #fox-pricing-table li { padding: 10px 0; } /* --------------- */ #fox-pricing-table .signup { position: relative; padding: 10px 20px; color: #fff; font: bold 14px Arial, Helvetica; text-transform: uppercase; text-decoration: none; display: inline-block; background-color: #72ce3f; -moz-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; text-shadow: 0 -1px 0 rgba(0, 0, 0, .15); opacity: .9; } #fox-pricing-table .signup:hover { opacity: 1; } #fox-pricing-table .signup:active { -moz-box-shadow: 0 2px 2px rgba(0, 0, 0, .3) inset; -webkit-box-shadow: 0 2px 2px rgba(0, 0, 0, .3) inset; box-shadow: 0 2px 2px rgba(0, 0, 0, .3) inset; } #fox-pricing-table .plan1 .signup { background: #B3E03F; } #fox-pricing-table .plan2 .signup { background: #f36347; } #fox-pricing-table .plan3 .signup { background: #85bf31; } #fox-pricing-table .plan4 .signup { background: #45D0DA; } </style> </head> <body> <div class="container1"> <!-- foxpricing top bar --> <header> <h1>CSS For Pricing Table</h1> </header> <!-- start header here--> <header> <div id="fox-pricing-table"> <div class="plan plan1"> <div class="header">Enterprise</div> <div class="price">$99</div> <div class="monthly">per month</div> <ul> <li><b>20GB</b> Disk Space</li> <li><b>1000GB</b> Monthly Bandwidth</li> <li><b>30</b> Email Accounts</li> <li><b>Unlimited</b> subdomains</li> </ul> <a class="signup" href="#">Sign up</a> </div> <div class="plan plan2 popular-plan"> <div class="header">Professional</div> <div class="price">$49</div> <div class="monthly">per month</div> <ul> <li><b>10GB</b> Disk Space</li> <li><b>500GB</b> Monthly Bandwidth</li> <li><b>15</b> Email Accounts</li> <li><b>Unlimited</b> subdomains</li> </ul> <a class="signup" href="#">Sign up</a> </div> <div class="plan plan3"> <div class="header">Standard</div> <div class="price">$29</div> <div class="monthly">per month</div> <ul> <li><b>5GB</b> Disk Space</li> <li><b>250GB</b> Monthly Bandwidth</li> <li><b>5</b> Email Accounts</li> <li><b>Unlimited</b> subdomains</li> </ul> <a class="signup" href="#">Sign up</a> </div> <div class="plan plan4"> <div class="header">Basic</div> <div class="price">$19</div> <div class="monthly">per month</div> <ul> <li><b>2.5GB</b> Disk Space</li> <li><b>150GB</b> Monthly Bandwidth</li> <li><b>1</b> Email Accounts</li> <li><b>Unlimited</b> subdomains</li> </ul> <a class="signup" href="#">Sign up</a> </div> </div> </header> <!-- end header --> </div> </body> </html>
You can save the above code into an HTML file to see the output as shown here.