Email pill form

Email signup form in HTML and CSS: one input inside a thin pill outline, with a yellow serif button and a hard 1px offset shadow.

The form is a flex row with a 999px border radius, so the input and button sit inside one pill outline. The input has no border of its own, and :focus-within on the form draws a two-layer box-shadow ring when the field has focus. The button's hard shadow is a box-shadow with no blur: on hover the button moves 1px up and left and the shadow grows to 2px, and on :active the shadow goes away. The input is type=email with required and a visually hidden label, and the form's inline onsubmit stops navigation, so replace it with your own action.

Open preview
snippet.html18 lines
<form class="epf" action="#" onsubmit="return false">
  <label class="epf__label" for="epf-email">Email address</label>
  <input class="epf__input" id="epf-email" type="email" name="email" placeholder="Enter your email" autocomplete="email" required>
  <button class="epf__btn" type="submit">Save my spot</button>
</form>

<style>
  .epf { --epf-ink: #121a0e; --epf-yellow: #ffee6f; display: flex; align-items: center; width: min(100%, 454px); padding: 6px; border: 1px solid var(--epf-ink); border-radius: 999px; background: #fff; font-family: ui-sans-serif, system-ui, sans-serif; transition: box-shadow 0.15s; }
  .epf:focus-within { box-shadow: 0 0 0 3px #ffee6f, 0 0 0 4px var(--epf-ink); }
  .epf__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .epf__input { flex: 1; min-width: 0; padding: 0.6rem 0.9rem; border: 0; outline: 0; background: transparent; color: var(--epf-ink); font: inherit; font-size: 1rem; }
  .epf__input::placeholder { color: rgb(18 26 14 / 0.45); }
  .epf__btn { flex: none; padding: 0.4rem 0.95rem; border: 1px solid var(--epf-ink); border-radius: 999px; background: var(--epf-yellow); color: var(--epf-ink); font: 400 1rem/1.6 ui-serif, Georgia, serif; box-shadow: 1px 1px 0 #000; cursor: pointer; transition: transform 0.15s, box-shadow 0.15s; }
  .epf__btn:hover { transform: translate(-1px, -1px); box-shadow: 2px 2px 0 #000; }
  .epf__btn:active { transform: translate(1px, 1px); box-shadow: 0 0 0 #000; }
  .epf__btn:focus-visible { outline: 2px solid var(--epf-ink); outline-offset: 2px; }
  @media (prefers-reduced-motion: reduce) { .epf, .epf__btn { transition: none; } }
</style>

Kind
Component
Category
Form
Added
6 Nov 2026
Canvas
Centered
File
snippet.html
Size
18 lines · 1.6 KB
Inspired by
onhomeroom.com
  • light
  • pill
  • waitlist
  • hard-shadow

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