CSS How to Create a Pricing Table Using HTML and CSS
CSS How to Create a Pricing Table Using HTML and CSS
We can create a basic pricing table using only HTML and CSS. Pricing tables can be a useful feature on various websites that involve purchasing products, such as e-commerce applications or travel websites. Let’s learn how to create such a table with the help of the following example.
Example
We will first create an HTML layout for the table in the index.html file below and then add styles to it.
<html lang="en">
<head>
<title>How to Create Pricing Table using HTML and CSS?</title>
<style>
.cards {
display: flex;
gap: 10px;
}
.cards ul {
list-style-type: none;
border: 1px solid;
margin: 0;
padding: 0;
}
.cardsulli{
border-bottom: 1px solid;
text-align: center;
padding: 10px;
}
.cards ul .header {
background-color: black;
color: white;
font-size: 1rem;
}
.cards ul .button {
background-color: green;
cursor: pointer;
color: white;
padding: 5px 10px;
}
</style>
</head>
<body>
<h3>How to Create Pricing Table using HTML and CSS?</h3>
<div class="cards">
<ul class="gold">
<li class="header">Gold</li>
<li><span class="katex math inline">9.99</li>
<li>10 API calls per day</li>
<li class="button">Sign up</li>
</ul>
<ul class="silver">
<li class="header">Silver</li>
<li></span>19.99</li>
<li>100 API calls per day</li>
<li class="button">Sign up</li>
</ul>
<ul class="platinum">
<li class="header">Platinum</li>
<li>$29.99</li>
<li>500 API calls per day</li>
<li class="button">Sign up</li>
</ul>
</div>
</body>
</html>
Summary
In this article, we learned how to create a basic pricing table using only HTML and CSS. We first created our basic structural layout using the index.html file, and then we added styles to it.