This contact form includes a subject dropdown to help route inquiries efficiently and improve response handling.
HTML
<form class="contact-subject">
<h3>Contact Us</h3>
<p class="subtitle">Choose a subject so we can help faster</p>
<input type="text" placeholder="Your name" required>
<input type="email" placeholder="Email address" required>
<select required>
<option value="" disabled selected>Select subject</option>
<option>General Inquiry</option>
<option>Support</option>
<option>Sales</option>
<option>Feedback</option>
</select>
<textarea rows="4" placeholder="Your message" required></textarea>
<button type="button">Send Message</button>
</form>In production, change
type="button"totype="submit"and handle validation server-side or with JS.
CSS
:root{
--bg:#f8fafc;
--card:#ffffff;
--text:#0f172a;
--muted:#64748b;
--border:#e5e7eb;
--primary:#2563eb;
--primary-dark:#1d4ed8;
}
@media (prefers-color-scheme: dark){
:root{
--bg:#020617;
--card:#020617;
--text:#e5e7eb;
--muted:#94a3b8;
--border:#1f2937;
--primary:#3b82f6;
--primary-dark:#60a5fa;
}
}
.contact-subject{
max-width:420px;
margin:80px auto;
padding:32px;
background:var(--card);
border-radius:18px;
border:1px solid var(--border);
box-shadow:0 16px 40px rgba(0,0,0,.12);
font-family:system-ui, -apple-system, sans-serif;
color:var(--text);
}
.contact-subject h3{
font-size:22px;
margin-bottom:6px;
}
.contact-subject .subtitle{
font-size:14px;
color:var(--muted);
margin-bottom:24px;
}
.contact-subject input,
.contact-subject select,
.contact-subject textarea{
width:100%;
padding:14px 16px;
margin-bottom:16px;
border-radius:12px;
border:1px solid var(--border);
background:linear-gradient(180deg,var(--card),var(--bg));
color:var(--text);
font-size:15px;
outline:none;
resize:none;
transition:border .2s ease, box-shadow .2s ease;
}
.contact-subject input::placeholder,
.contact-subject textarea::placeholder{
color:var(--muted);
}
.contact-subject select{
color:var(--muted);
}
.contact-subject input:focus,
.contact-subject select:focus,
.contact-subject textarea:focus{
border-color:var(--primary);
box-shadow:0 0 0 4px rgba(37,99,235,.18);
color:var(--text);
}
.contact-subject button{
width:100%;
padding:14px;
border:none;
border-radius:12px;
background:linear-gradient(
135deg,
var(--primary),
var(--primary-dark)
);
color:#ffffff;
font-size:15px;
font-weight:600;
cursor:pointer;
transition:transform .15s ease, box-shadow .15s ease;
}
.contact-subject button:hover{
transform:translateY(-1px);
box-shadow:0 12px 30px rgba(0,0,0,.2);
}
.contact-subject button:active{
transform:translateY(0);
box-shadow:none;
}Notes
- Better inquiry categorization
- Useful for businesses & SaaS
- Improves internal workflows
Preview styles shown. Production customization recommended.
Browse More UI Components
Explore hundreds of reusable HTML & CSS UI components built for modern web projects.
Discover buttons, cards, loaders, animations, layouts, and more all with live previews and clean, copy-paste code.
