CSS Split Screen Login
A sign-in page split into a brand panel and a centered form, with the panel turning into a banner on phones.
<div class="split-login">
<div class="split-login-art" aria-hidden="true"></div>
<form class="split-login-form">
<h2>Sign in</h2>
<label>Email
<input type="email" autocomplete="email" placeholder="you@example.com">
</label>
<button type="submit">Continue</button>
</form>
</div>
.split-login {
display: grid;
grid-template-columns: 1fr 1fr;
min-height: 100vh;
min-height: 100dvh;
background: #ffffff;
}
.split-login-art {
background:
radial-gradient(circle at 30% 30%, #f472b6, #f472b600 60%),
linear-gradient(135deg, #4f46e5, #7c3aed);
}
.split-login-form {
display: grid;
align-content: center;
gap: 14px;
box-sizing: border-box;
width: min(100%, 340px);
margin: 0 auto;
padding: 32px 24px;
color: #0f172a;
font: 15px/1.4 system-ui, sans-serif;
}
.split-login-form h2 {
margin: 0;
font-size: 26px;
}
.split-login-form label {
display: grid;
gap: 6px;
color: #475569;
font-weight: 600;
}
.split-login-form input {
padding: 11px 12px;
border: 1px solid #cbd5e1;
border-radius: 10px;
font: inherit;
}
.split-login-form button {
padding: 11px 12px;
border: 0;
border-radius: 10px;
background: #4f46e5;
color: #ffffff;
font: 600 15px system-ui, sans-serif;
cursor: pointer;
}
.split-login-form input:focus-visible,
.split-login-form button:focus-visible {
outline: 2px solid #4f46e5;
outline-offset: 2px;
}
/* Phones: the art becomes a short banner on top */
@media (max-width: 720px) {
.split-login {
grid-template-columns: 1fr;
grid-template-rows: 140px 1fr;
}
}
About this CSS Split Screen Login
This CSS Split Screen Login is 68 lines of pure CSS (1.2 KB) with no JavaScript and no dependencies. It uses linear gradients, radial gradients, CSS Grid and keyboard focus styles. It works in current versions of Chrome, Edge, Safari and Firefox. It works in any stack: plain HTML, React, Vue, Svelte, Astro, WordPress or Webflow.
CSS features used
Customize it
The colors in this snippet. Search and replace them to match your brand:
#ffffff#f472b6#f472b600#4f46e5#7c3aed#0f172a#475569#cbd5e1
How to use this split screen login
- Copy the HTML and paste it where you want the element to appear.
- Copy the CSS into your stylesheet, or inside a
<style>tag. - Keep the
.split-loginclass name, or rename it in both places. Then tweak colors, sizes and timing to match your design. - Using React or Next.js? Change
classtoclassNamein the HTML. The CSS works as is, including in Tailwind projects (put it in your global stylesheet).
Building with an AI tool?
“Copy for AI” copies a short prompt for Cursor, Claude Code, Lovable, Bolt or v0. Your AI tool opens the Markdown version of this snippet and reads the HTML, CSS and setup notes there. If your tool can't open links, with the code instead. More ways to use copy CSS with AI.