Back to CSS Floating Buttons Labeled Pill Pure CSS
Share
.cfb-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 22px 14px 18px;
  border: 0; border-radius: 999px;
  background: linear-gradient(135deg, #7c6cff, #ff6c8a);
  color: #fff;
  font: 600 14px/1 system-ui, sans-serif;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(124,108,255,0.35);
  transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.25s, filter 0.2s;
}
.cfb-pill:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(124,108,255,0.45);
  filter: brightness(1.05);
}
.cfb-pill:active { transform: translateY(0); }
.cfb-pill:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.cfb-pill svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; }
<button type="button" class="cfb-pill">
  <svg viewBox="0 0 24 24" aria-hidden="true">
    <line x1="12" y1="5" x2="12" y2="19" />
    <line x1="5" y1="12" x2="19" y2="12" />
  </svg>
  <span>New project</span>
</button>
Live preview Edit any tab — preview updates live Ready