Code Library
CSS Snippets for White Backgrounds
Production-ready CSS patterns for creating depth, dimension, and elegance on white backgrounds. Click to copy any snippet.
.card {
background: #ffffff;
border-radius: 12px;
box-shadow:
0 4px 20px rgba(0,0,0,0.06),
0 1px 3px rgba(0,0,0,0.04);
}
.card {
background: #ffffff;
border-radius: 12px;
border: 1px solid
rgba(0, 0, 0, 0.06);
}
.neumorphic {
background: #f0f0f0;
border-radius: 20px;
box-shadow:
8px 8px 16px #d1d1d1,
-8px -8px 16px #ffffff;
}
.glass {
background: rgba(255,255,255,0.5);
backdrop-filter: blur(8px);
border-radius: 12px;
border: 1px solid
rgba(255,255,255,0.8);
}
Hover me
.card {
transition: transform 0.3s ease,
box-shadow 0.3s ease;
}
.card:hover {
transform: translateY(-4px);
box-shadow: 0 12px 32px
rgba(0,0,0,0.1);
}
.gradient-border {
background: #fff;
border-radius: 12px;
position: relative;
}
.gradient-border::before {
content: '';
position: absolute;
inset: -1px;
border-radius: 13px;
background: linear-gradient(
135deg, #e0e0e0,
#f5f5f5, #e0e0e0);
z-index: -1;
}
Clean slate for white backgrounds
*, *::before, *::after {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
background: #FFFFFF;
min-height: 100vh;
-webkit-font-smoothing:
antialiased;
}
.deep-shadow {
box-shadow:
0 1px 1px rgba(0,0,0,.02),
0 2px 4px rgba(0,0,0,.02),
0 4px 8px rgba(0,0,0,.03),
0 8px 16px rgba(0,0,0,.03),
0 16px 32px rgba(0,0,0,.04);
}
.inset-card {
background: #ffffff;
border-radius: 12px;
box-shadow:
inset 0 2px 4px
rgba(0,0,0,0.04),
inset 0 0 0 1px
rgba(0,0,0,0.04);
}