About this snippet

Grow your mailing list with this sleek subscribe form. The input and button are visually unified into a single pill-shaped component, which creates a very clean and focused user action.

Size
1.4 KB
Uses
HTML, CSS
Loads
Nothing external
Views
345
<div class="newsletter-box">
  <h3>Join our Newsletter</h3>
  <p>Get the latest updates delivered to your inbox.</p>
  <form class="subscribe-form">
    <input type="email" placeholder="Enter your email address" required>
    <button type="submit">Subscribe</button>
  </form>
</div>
.newsletter-box {
  font-family: system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  background: #fff;
  padding: 40px;
  border-radius: 20px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0,0,0,0.05);
  max-width: 500px;
  border: 1px solid #f3f4f6;
}
.newsletter-box h3 {
  margin: 0 0 10px 0;
  color: #111827;
  font-size: 1.5rem;
}
.newsletter-box p {
  color: #6b7280;
  margin-bottom: 25px;
}
.subscribe-form {
  display: flex;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 50px;
  padding: 5px;
  transition: border-color 0.2s;
}
.subscribe-form:focus-within {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}
.subscribe-form input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 10px 20px;
  outline: none;
  font-size: 1rem;
  color: #1f2937;
}
.subscribe-form button {
  background: #111827;
  color: white;
  border: none;
  padding: 10px 25px;
  border-radius: 50px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.subscribe-form button:hover {
  background: #000;
}
Esc
↑↓ moveEnter select

Start from a template

Open an .html file, or HTML, CSS, JS, Markdown, Less or TypeScript files. You can also drop them here. Styles and scripts go into their panes.

Share

Source

Keyboard shortcuts

Save