PricingMonthly and Yearly Billing Toggle
A two-option billing switch that changes three example plan prices between monthly and yearly and works the saving out from the prices.
A three-plan pricing table with a featured plan, feature lists that use words as well as ticks, and a button on each plan. All prices are labelled as examples.
Checked on 3 December 2026 in Chrome 143.0.7499.169: 12 automated checks. What the checks are
<!-- Each plan button is a button because nothing here is on sale. In real work swap it for a link, for example
<a class="pt__cta" href="/checkout/team">Start with Team</a>: the .pt__cta rule styles links the same way. -->
<section class="pt" aria-labelledby="pt-title">
<header class="pt__head">
<h2 class="pt__title" id="pt-title">Choose a plan</h2>
<p class="pt__caption">Example prices for a made-up product. Nothing here is on sale.</p>
</header>
<ul class="pt__plans">
<li class="pt__plan" aria-labelledby="pt-solo">
<h3 class="pt__name" id="pt-solo">Example Solo</h3>
<p class="pt__blurb">For one person trying things out.</p>
<p class="pt__price"><span class="pt__eg">Example</span><span class="pt__amount">£0</span><span class="pt__per">per month</span></p>
<ul class="pt__features">
<li><span class="pt__mark" aria-hidden="true">✓</span><span class="pt__sr">Included: </span>1 project</li>
<li><span class="pt__mark" aria-hidden="true">✓</span><span class="pt__sr">Included: </span>Community help</li>
<li class="pt__off"><span class="pt__mark" aria-hidden="true">–</span><span class="pt__sr">Not included: </span>Shared workspace</li>
<li class="pt__off"><span class="pt__mark" aria-hidden="true">–</span><span class="pt__sr">Not included: </span>Priority replies</li>
</ul>
<button class="pt__cta" type="button">Start with Solo</button>
</li>
<li class="pt__plan pt__plan--featured" aria-labelledby="pt-team">
<p class="pt__flag">Featured plan</p>
<h3 class="pt__name" id="pt-team">Example Team</h3>
<p class="pt__blurb">For a small group working together.</p>
<p class="pt__price"><span class="pt__eg">Example</span><span class="pt__amount">£12</span><span class="pt__per">per month</span></p>
<ul class="pt__features">
<li><span class="pt__mark" aria-hidden="true">✓</span><span class="pt__sr">Included: </span>10 projects</li>
<li><span class="pt__mark" aria-hidden="true">✓</span><span class="pt__sr">Included: </span>Shared workspace</li>
<li><span class="pt__mark" aria-hidden="true">✓</span><span class="pt__sr">Included: </span>Email help</li>
<li class="pt__off"><span class="pt__mark" aria-hidden="true">–</span><span class="pt__sr">Not included: </span>Priority replies</li>
</ul>
<button class="pt__cta" type="button">Start with Team</button>
</li>
<li class="pt__plan" aria-labelledby="pt-studio">
<h3 class="pt__name" id="pt-studio">Example Studio</h3>
<p class="pt__blurb">For a larger group with many projects.</p>
<p class="pt__price"><span class="pt__eg">Example</span><span class="pt__amount">£36</span><span class="pt__per">per month</span></p>
<ul class="pt__features">
<li><span class="pt__mark" aria-hidden="true">✓</span><span class="pt__sr">Included: </span>Unlimited projects</li>
<li><span class="pt__mark" aria-hidden="true">✓</span><span class="pt__sr">Included: </span>Shared workspace</li>
<li><span class="pt__mark" aria-hidden="true">✓</span><span class="pt__sr">Included: </span>Email help</li>
<li><span class="pt__mark" aria-hidden="true">✓</span><span class="pt__sr">Included: </span>Priority replies</li>
</ul>
<button class="pt__cta" type="button">Start with Studio</button>
</li>
</ul>
</section>.pt {
--pt-surface: #ffffff;
--pt-ink: #1c1a2e;
--pt-muted: #565370;
--pt-line: #dedcec;
--pt-wash: #f6f5fb;
--pt-accent: #4a34c4;
--pt-accent-ink: #ffffff;
--pt-tick: #0e7a58;
--pt-ring: #1c1a2e;
--pt-feat-bg: #231b5c;
--pt-feat-ink: #f5f3ff;
--pt-feat-muted: #cbc5f0;
--pt-feat-line: #4a3f94;
--pt-feat-btn: #ffffff;
--pt-feat-btn-ink: #231b5c;
--pt-feat-ring: #ffffff;
box-sizing: border-box;
container-type: inline-size;
width: min(100%, 60rem);
padding: 1.5rem;
color: var(--pt-ink);
background: var(--pt-wash);
border-radius: 20px;
font: 1rem/1.45 system-ui, system, "Segoe UI", Roboto, sans-serif;
}
.pt *, .pt *::before, .pt *::after { box-sizing: border-box; }
.pt__head { margin-bottom: 1rem; text-align: center; }
.pt__title { margin: 0; font-size: 1.5rem; line-height: 1.2; }
.pt__caption { margin: 0.35rem auto 0; max-width: 32rem; font-size: 0.9rem; color: var(--pt-muted); }
.pt__plans { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; align-items: stretch; }
.pt__plan { position: relative; display: flex; flex-direction: column; padding: 1.25rem; background: var(--pt-surface); border: 1px solid var(--pt-line); border-radius: 16px; }
.pt__plan--featured { color: var(--pt-feat-ink); background: var(--pt-feat-bg); border-color: var(--pt-feat-bg); box-shadow: 0 18px 36px -16px rgb(35 27 92 / 55%); }
.pt__flag { align-self: flex-start; margin: 0 0 0.6rem; padding: 0.15rem 0.6rem; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--pt-feat-btn-ink); background: #ffd66b; border-radius: 999px; }
.pt__name { margin: 0; font-size: 1.15rem; line-height: 1.25; }
.pt__blurb { margin: 0.25rem 0 0; font-size: 0.9rem; color: var(--pt-muted); }
.pt__plan--featured .pt__blurb { color: var(--pt-feat-muted); }
.pt__price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 0.4rem; margin: 0.75rem 0; padding: 0.7rem 0; border-top: 1px solid var(--pt-line); border-bottom: 1px solid var(--pt-line); }
.pt__plan--featured .pt__price { border-color: var(--pt-feat-line); }
.pt__eg { flex-basis: 100%; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--pt-muted); }
.pt__plan--featured .pt__eg { color: var(--pt-feat-muted); }
.pt__amount { font-size: 2.4rem; font-weight: 800; line-height: 1.1; letter-spacing: -0.02em; }
.pt__per { font-size: 0.9rem; color: var(--pt-muted); }
.pt__plan--featured .pt__per { color: var(--pt-feat-muted); }
.pt__features { flex: 1; list-style: none; margin: 0 0 1.25rem; padding: 0; display: grid; gap: 0.55rem; font-size: 0.95rem; }
.pt__features li { display: grid; grid-template-columns: 1.4rem 1fr; align-items: start; gap: 0.4rem; }
.pt__mark { display: grid; place-items: center; width: 1.2rem; height: 1.2rem; margin-top: 0.1rem; font-size: 0.75rem; font-weight: 800; color: var(--pt-surface); background: var(--pt-tick); border-radius: 50%; }
.pt__off { color: var(--pt-muted); text-decoration: line-through; text-decoration-thickness: 1px; }
.pt__off .pt__mark { color: var(--pt-muted); background: transparent; border: 1.5px solid var(--pt-muted); }
.pt__plan--featured .pt__off { color: var(--pt-feat-muted); }
.pt__plan--featured .pt__off .pt__mark { color: var(--pt-feat-muted); background: transparent; border-color: var(--pt-feat-muted); }
.pt__plan--featured .pt__mark { background: #7be0b5; color: #0b3b2a; }
.pt__sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.pt__cta { display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; text-decoration: none; min-height: 46px; padding: 0 1rem; font: inherit; font-weight: 700; color: var(--pt-accent); background: transparent; border: 2px solid var(--pt-accent); border-radius: 12px; cursor: pointer; }
.pt__cta:hover { background: var(--pt-wash); }
.pt__plan--featured .pt__cta { color: var(--pt-feat-btn-ink); background: var(--pt-feat-btn); border-color: var(--pt-feat-btn); }
.pt__plan--featured .pt__cta:hover { background: #ece8ff; }
.pt__cta:focus-visible { outline: 3px solid var(--pt-ring); outline-offset: 3px; }
.pt__plan--featured .pt__cta:focus-visible { outline-color: var(--pt-feat-ring); }
@container (min-width: 36rem) {
.pt__plans { grid-template-columns: repeat(3, 1fr); }
.pt__plan--featured { margin-block: -0.5rem; padding-block: 1.75rem; }
}
@container (max-width: 26rem) {
.pt__amount { font-size: 2rem; }
}
@media (max-width: 26rem) {
.pt { padding: 1rem; }
}
@media (prefers-color-scheme: dark) {
.pt {
--pt-surface: #1a1830; --pt-ink: #efedfb; --pt-muted: #b6b2d4; --pt-line: #38345f; --pt-wash: #121124;
--pt-accent: #b7a8ff; --pt-tick: #4fd6a3; --pt-ring: #efedfb;
--pt-feat-bg: #3a2ea0; --pt-feat-ink: #ffffff; --pt-feat-muted: #ddd8ff; --pt-feat-line: #6a5ee0; --pt-feat-btn: #ffffff; --pt-feat-btn-ink: #2a2078;
}
.pt__mark { color: #102b21; }
.pt__off .pt__mark { color: var(--pt-muted); }
.pt__plan--featured { border-color: #6a5ee0; }
}Written by the author of the snippet. Each note has a test step or a markup check that reads the page.
PricingA two-option billing switch that changes three example plan prices between monthly and yearly and works the saving out from the prices.
CardsFour card layouts on one auto-fit grid: stacked, horizontal, a whole-card link and a compact list, with light and dark colours.
LayoutA header, a sidebar and a main area on CSS grid with a sticky header and one scrolling region; the sidebar folds behind a button on a narrow shell.