Skip to content

Instantly share code, notes, and snippets.

@w3collective
Created February 10, 2021 07:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save w3collective/d6bcaa9306a522ab40b597acd9c7baee to your computer and use it in GitHub Desktop.
Save w3collective/d6bcaa9306a522ab40b597acd9c7baee to your computer and use it in GitHub Desktop.
3 column pricing table layout with CSS flexbox
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>3 column pricing table layout with CSS flexbox</title>
<style>
body {
background-color: #181b1d;
font-family: sans-serif;
}
.pricing {
display: flex;
justify-content: space-between;
max-width: 960px;
margin: auto;
}
.pricing-plan {
flex: 1;
background-color: #1f262c;
margin: 15px 8px;
padding: 30px;
border-radius: 6px;
color: #fff;
}
.pricing-plan h2 {
margin-top: 0;
padding-bottom: 10px;
border-bottom: 2px solid #e30046;
text-transform: uppercase;
letter-spacing: 0.07em;
}
.pricing-plan p {
margin-top: 0;
}
.pricing-plan p span {
font-size: 33px;
}
.pricing-plan ul {
margin: 0 0 35px;
padding-left: 16px;
list-style: none;
line-height: 1.8;
color: #b5b5b5;
}
.pricing-plan ul li::before {
content: "•";
color: #e30046;
display: inline-block;
width: 20px;
margin-left: -15px;
position: relative;
top: 4px;
font-size: 26px;
line-height: 0;
}
.pricing-plan a {
text-decoration: none;
color: #fff;
padding: 10px 20px;
text-align: center;
background: #e30046;
border: 2px solid #e30046;
border-radius: 5px;
letter-spacing: 0.05em;
text-transform: uppercase;
font-size: 15px;
font-weight: bold;
}
.pricing-plan a:hover {
background-color: #1f262c;
}
@media (max-width: 768px) {
.pricing {
display: block;
}
}
</style>
</head>
<body>
<div class="pricing">
<div class="pricing-plan">
<h2>Basic</h2>
<p><span>$3.95</span> / month</p>
<ul>
<li>1 Website</li>
<li>1GB Storage</li>
<li>Unlimited Bandwidth</li>
<li>24/7 Support</li>
</ul>
<a href="#">Sign up</a>
</div>
<div class="pricing-plan">
<h2>Premium</h2>
<p><span>$16.95</span> / month</p>
<ul>
<li>10 Websites</li>
<li>10GB Storage</li>
<li>Unlimited Bandwidth</li>
<li>24/7 Support</li>
</ul>
<a href="#">Sign up</a>
</div>
<div class="pricing-plan">
<h2>Advanced</h2>
<p><span>$27.50</span> / month</p>
<ul>
<li>Unlimited Websites</li>
<li>Unlimited Storage</li>
<li>Unlimted Bandwidth</li>
<li>24/7 Support</li>
</ul>
<a href="#">Sign up</a>
</div>
</div>
</body>
</html>
@w3collective
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment