Pill button pair

CSS pill button pair: a solid blue primary and an outlined secondary that fills on hover, for dark product pages.

Two links share one .pbp__btn class: a 980px border radius, a 1px border and the same padding. The primary is filled blue and shifts to a lighter blue on hover. The secondary has a transparent background with a blue border and text, and on hover it fills with the border color and the text turns black. :active scales either button to 0.97, :focus-visible adds a white outline plus a blue box-shadow ring, and the flex wrapper wraps so the pair can stack.

Open preview
snippet.html16 lines
<div class="pbp">
  <a class="pbp__btn pbp__btn--solid" href="#">Learn more</a>
  <a class="pbp__btn pbp__btn--line" href="#">Pre-order</a>
</div>

<style>
  .pbp { --pbp-blue: #0071e3; --pbp-blue-hover: #0077ed; --pbp-line: #2997ff; display: flex; flex-wrap: wrap; justify-content: center; gap: 17px; font-family: ui-sans-serif, -apple-system, "SF Pro Text", "Helvetica Neue", system-ui, sans-serif; }
  .pbp__btn { display: inline-block; box-sizing: border-box; padding: 11px 21px; border: 1px solid var(--pbp-blue); border-radius: 980px; font-size: 17px; line-height: 1.17; letter-spacing: -0.01em; text-decoration: none; transition: background-color 0.2s, color 0.2s, border-color 0.2s, transform 0.15s; }
  .pbp__btn--solid { background: var(--pbp-blue); color: #fff; }
  .pbp__btn--solid:hover { background: var(--pbp-blue-hover); border-color: var(--pbp-blue-hover); }
  .pbp__btn--line { border-color: var(--pbp-line); color: var(--pbp-line); }
  .pbp__btn--line:hover { background: var(--pbp-line); color: #000; }
  .pbp__btn:active { transform: scale(0.97); }
  .pbp__btn:focus-visible { outline: 2px solid #fff; outline-offset: 3px; box-shadow: 0 0 0 5px var(--pbp-blue); }
  @media (prefers-reduced-motion: reduce) { .pbp__btn { transition: none; } }
</style>

Kind
Component
Category
Button
Added
6 Nov 2026
Canvas
Centered
File
snippet.html
Size
16 lines · 1.2 KB
Inspired by
www.apple.com
  • dark
  • pill
  • pair
  • cta

One file: HTML, a style block and, when needed, a small script. Paste it anywhere. Nothing to install.