html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Responsive Pricing Table</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
min-height: 100vh;
padding: 2rem 1rem;
color: #333;
}
.pricing-container {
max-width: 1200px;
margin: 0 auto;
}
.pricing-header {
text-align: center;
margin-bottom: 3rem;
color: white;
}
.pricing-header h1 {
font-size: 2.5rem;
margin-bottom: 0.5rem;
}
.pricing-header p {
font-size: 1.2rem;
opacity: 0.9;
}
.toggle-container {
display: flex;
justify-content: center;
margin-bottom: 3rem;
gap: 1rem;
}
.toggle {
background: rgba(255, 255, 255, 0.2);
border: none;
padding: 0.75rem 1.5rem;
border-radius: 50px;
color: white;
font-size: 1rem;
cursor: pointer;
transition: all 0.3s ease;
backdrop-filter: blur(10px);
}
.toggle:hover,
.toggle.active {
background: rgba(255, 255, 255, 0.9);
color: #333;
transform: scale(1.05);
}
.pricing-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
gap: 2rem;
margin-bottom: 2rem;
}
.plan-card {
background: rgba(255, 255, 255, 0.95);
backdrop-filter: blur(20px);
border-radius: 24px;
padding: 2.5rem 2rem;
text-align: center;
box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
position: relative;
overflow: hidden;
}
.plan-card::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
height: 4px;
background: linear-gradient(90deg, #667eea, #764ba2);
opacity: 0;
transition: opacity 0.3s ease;
}
.plan-card:hover::before {
opacity: 1;
}
.plan-card:hover {
transform: translateY(-20px) scale(1.02);
box-shadow: 0 40px 80px rgba(0, 0, 0, 0.2);
}
.plan-header h2 {
font-size: 1.8rem;
margin-bottom: 0.5rem;
color: #333;
}
.price {
font-size: 3rem;
font-weight: bold;
color: #667eea;
margin-bottom: 0.5rem;
position: relative;
}
.price span {
font-size: 0.8rem;
font-weight: normal;
color: #666;
vertical-align: top;
}
.features {
list-style: none;
margin: 2rem 0;
}
.features li {
display: flex;
align-items: center;
justify-content: center;
padding: 0.75rem 0;
position: relative;
font-size: 1rem;
cursor: help;
}
.features li::before {
content: '✓';
color: #4CAF50;
font-weight: bold;
font-size: 1.2rem;
margin-right: 0.75rem;
}
.features li:hover::after {
content: attr(data-tooltip);
position: absolute;
bottom: 100%;
left: 50%;
transform: translateX(-50%);
background: #333;
color: white;
padding: 0.75rem 1rem;
border-radius: 8px;
font-size: 0.85rem;
white-space: nowrap;
z-index: 100;
box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
margin-bottom: 0.5rem;
}
.features li:hover::before {
content: '';
position: absolute;
bottom: 100%;
left: 50%;
transform: translateX(-50%);
width: 0;
height: 0;
border-left: 6px solid transparent;
border-right: 6px solid transparent;
border-top: 6px solid #333;
z-index: 101;
margin-bottom: 0;
}
.cta-button {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
border: none;
padding: 1rem 2rem;
border-radius: 50px;
font-size: 1.1rem;
font-weight: bold;
cursor: pointer;
transition: all 0.3s ease;
width: 100%;
text-transform: uppercase;
letter-spacing: 0.5px;
}
.cta-button:hover {
transform: scale(1.05);
box-shadow: 0 10px 20px rgba(102, 126, 234, 0.4);
}
/* Popular Plan Styles */
.popular {
border: 3px solid #FFD700;
transform: scale(1.05);
}
.popular::after {
content: '💎 POPULAR';
position: absolute;
top: -10px;
left: 50%;
transform: translateX(-50%);
background: #FFD700;
color: #333;
padding: 0.25rem 1rem;
border-radius: 20px;
font-size: 0.8rem;
font-weight: bold;
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}
/* Responsive Design */
@media (max-width: 768px) {
.pricing-grid {
grid-template-columns: 1fr;
gap: 1.5rem;
}
.pricing-header h1 {
font-size: 2rem;
}
.plan-card {
padding: 2rem 1.5rem;
}
.price {
font-size: 2.5rem;
}
.toggle-container {
flex-direction: column;
align-items: center;
gap: 0.5rem;
}
.features li:hover::after {
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
max-width: 80vw;
white-space: normal;
text-align: center;
font-size: 1rem;
}
}
@media (max-width: 480px) {
body {
padding: 1rem 0.5rem;
}
.price {
font-size: 2rem;
}
}
</style>
</head>
<body>
<div class="pricing-container">
<div class="pricing-header">
<h1>Choose Your Plan</h1>
<p>Simple, transparent pricing to fit your needs</p>
</div>
<div class="toggle-container">
<button class="toggle monthly active" data-period="monthly">Monthly</button>
<button class="toggle annual" data-period="annual">Annual (Save 20%)</button>
</div>
<div class="pricing-grid">
<div class="plan-card" data-plan="starter">
<div class="plan-header">
<h2>Starter</h2>
<div class="price" data-monthly="9" data-annual="72">$9<span>/mo</span></div>
</div>
<ul class="features">
<li data-tooltip="Up to 1 team member">1 User</li>
<li data-tooltip="Manage up to 5 projects comfortably">5 Projects</li>
<li data-tooltip="Email support during business hours">Basic Email Support</li>
<li data-tooltip="1GB storage included">1GB Storage</li>
</ul>
<button class="cta-button">Get Started</button>
</div>
<div class="plan-card popular" data-plan="pro">
<div class="plan-header">
<h2>Professional</h2>
<div class="price" data-monthly="29" data-annual="233">$29<span>/mo</span></div>
</div>
<ul class="features">
<li data-tooltip="Up to 5 team members">5 Users</li>
<li data-tooltip="No limits on project creation">Unlimited Projects</li>
<li data-tooltip="Priority email & live chat support">Priority Support</li>
<li data-tooltip="10GB storage included">10GB Storage</li>
<li data-tooltip="Custom integrations available">API Access</li>
</ul>
<button class="cta-button">Get Started</button>
</div>
<div class="plan-card" data-plan="enterprise">
<div class="plan-header">
<h2>Enterprise</h2>
<div class="price" data-monthly="99" data-annual="792">$99<span>/mo</span></div>
</div>
<ul class="features">
<li data-tooltip="Unlimited team members">Unlimited Users</li>
<li data-tooltip="Everything unlimited">Unlimited Everything</li>
<li data-tooltip="24/7 phone, email & chat support">Premium Support</li>
<li data-tooltip="Unlimited storage">Unlimited Storage</li>
<li data-tooltip="Dedicated account manager">Account Manager</li>
<li data-tooltip="SLA & custom features">Custom SLA</li>
</ul>
<button class="cta-button">Get Started</button>
</div>
</div>
</div>
<script>
// Pricing toggle functionality
const toggles = document.querySelectorAll('.toggle');
const prices = document.querySelectorAll('.price');
toggles.forEach(toggle => {
toggle.addEventListener('click', () => {
const period = toggle.dataset.period;
// Update active toggle
toggles.forEach(t => t.classList.remove('active'));
toggle.classList.add('active');
// Update prices
prices.forEach(price => {
const amount = price.dataset[period];
price.innerHTML = `$${amount}<span>/${period === 'monthly' ? 'mo' : 'yr'}</span>`;
});
});
});
// Optional: Add click handler for buttons (demo alert)
document.querySelectorAll('.cta-button').forEach(btn => {
btn.addEventListener('click', (e) => {
const plan = e.target.closest('.plan-card').dataset.plan;
alert(`Thanks for choosing the ${plan.toUpperCase()} plan! 🚀`);
});
});
// Smooth scroll or other enhancements can be added here
</script>
</body>
</html>
This is a complete, self-contained HTML file with a fully responsive CSS Grid-based pricing table.
Copy-paste into an HTML file and open in a browser to test! No external dependencies.