
- CSS Tutorial
- CSS - Home
- CSS - Introduction
- CSS - Syntax
- CSS - Inclusion
- CSS - Measurement Units
- CSS - Colors
- CSS - Backgrounds
- CSS - Fonts
- CSS - Text
- CSS - Images
- CSS - Links
- CSS - Tables
- CSS - Borders
- CSS - Margins
- CSS - Lists
- CSS - Padding
- CSS - Cursors
- CSS - Outlines
- CSS - Dimension
- CSS - Scrollbars
- CSS Advanced
- CSS - Visibility
- CSS - Positioning
- CSS - Layers
- CSS - Pseudo Classes
- CSS - Pseudo Elements
- CSS - @ Rules
- CSS - Text Effects
- CSS - Media Types
- CSS - Paged Media
- CSS - Aural Media
- CSS - Printing
- CSS - Layouts
- CSS - Validations
- CSS3 Tutorial
- CSS3 - Tutorial
- CSS3 - Rounded Corner
- CSS3 - Border Images
- CSS3 - Multi Background
- CSS3 - Color
- CSS3 - Gradients
- CSS3 - Shadow
- CSS3 - Text
- CSS3 - Web font
- CSS3 - 2d transform
- CSS3 - 3d transform
- CSS3 - Animation
- CSS3 - Multi columns
- CSS3 - User Interface
- CSS3 - Box Sizing
- CSS Responsive
- CSS - Responsive Web Design
- CSS References
- CSS - Questions and Answers
- CSS - Quick Guide
- CSS - References
- CSS - Color References
- CSS - Web browser References
- CSS - Web safe fonts
- CSS - Units
- CSS - Animation
- CSS Resources
- CSS - Useful Resources
- CSS - Discussion
How to create a responsive pricing table with CSS?
To create a responsive pricing table with CSS, the code is as follows −
Example
<!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <style> * { box-sizing: border-box; } body { font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif; } .compareFields { float: left; width: 50%; padding: 8px; } li { font-size: 18px; font-weight: 500; } .pricing { list-style-type: none; border: 1px solid #eee; margin: 0; padding: 0; -webkit-transition: 0.3s; transition: 0.3s; } .pricing:hover { box-shadow: 0 8px 12px 0 rgba(0, 0, 0, 0.2); } .pricing .header { background-color: rgb(52, 31, 129); color: white; font-size: 25px; } .pricing li { border-bottom: 1px solid #eee; padding: 20px; text-align: center; } .button { border: none; color: white; padding: 10px 25px; text-align: center; text-decoration: none; font-size: 18px; } @media only screen and (max-width: 600px) { .compareFields { width: 100%; } } </style> </head> <body> <h1 style="text-align:center">Responsive Pricing Tables Example</h1> <div class="compareFields"> <ul class="pricing"> <li class="header">Free Membership</li> <li>20 messages</li> <li>No customer Support</li> <li>98% uptime</li> <li>1GB per day</li> <li>50GB storage</li> <li> <a href="#" class="button" style="background-color: rgb(52, 31, 129);">Register</a> </li> </ul> </div> <div class="compareFields"> <ul class="pricing"> <li class="header" style="background-color:rgb(250, 136, 59)"> Advanced Membership </li> <li>100 messages</li> <li>24 * 7 customer support</li> <li>99.9% uptime</li> <li>8GB per day</li> <li>150GB storage</li> <li> <a href="#" class="button" style="background-color:rgb(250, 136, 59)">Register</a> </li> </ul> <div> </body> </html>
Output
The above code will produce the following output −
On resizing the screen −
- Related Articles
- How to create a responsive table with CSS?
- How to Create a Pricing Table using HTML and CSS?
- How to create a responsive header with CSS?
- How to create a responsive image with CSS?
- How to create a responsive form with CSS?
- How to create a responsive "timeline" with CSS?
- How to create responsive typography with CSS?
- How to create responsive testimonials with CSS?
- How to create a responsive image gallery with CSS
- How to create a responsive login form with CSS?
- How to create a responsive checkout form with CSS?
- How to create a responsive inline form with CSS?
- How to create a responsive blog layout with CSS?
- Create a responsive pagination with CSS
- How to create responsive floating elements with CSS?

Advertisements