32 CSS Search Box & Search Bar Designs 24 / 32
Dual Tone Outline
The border is split into two halves — left edge stays neutral while the right half lights up violet on focus.
The code
<form class="csb-dual" role="search"> <label class="csb-sr" for="csb-dual-i">Search</label> <input id="csb-dual-i" type="search" name="q" placeholder="Search..." /> </form>
<form class="csb-dual" role="search">
<label class="csb-sr" for="csb-dual-i">Search</label>
<input id="csb-dual-i" type="search" name="q" placeholder="Search..." />
</form>.csb-dual {
position: relative; display: inline-block;
padding: 1.5px;
background: linear-gradient(90deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.08) 50%, #7c6cff 50%, #7c6cff 100%);
background-size: 200% 100%;
background-position: 0% 0%;
border-radius: 10px;
transition: background-position 0.4s ease;
}
.csb-dual:focus-within { background-position: 100% 0%; }
.csb-dual input {
display: block;
width: 240px; padding: 11px 14px;
border: 0; outline: none;
background: #1a1a28;
border-radius: 9px;
color: #f0eeff; font: 500 14px/1 system-ui, sans-serif;
}
.csb-dual input::placeholder { color: #b8b6d4; }
.csb-sr {
position: absolute !important;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0, 0, 0, 0);
white-space: nowrap;
border: 0;
}
.csb-dual {
position: relative; display: inline-block;
padding: 1.5px;
background: linear-gradient(90deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.08) 50%, #7c6cff 50%, #7c6cff 100%);
background-size: 200% 100%;
background-position: 0% 0%;
border-radius: 10px;
transition: background-position 0.4s ease;
}
.csb-dual:focus-within { background-position: 100% 0%; }
.csb-dual input {
display: block;
width: 240px; padding: 11px 14px;
border: 0; outline: none;
background: #1a1a28;
border-radius: 9px;
color: #f0eeff; font: 500 14px/1 system-ui, sans-serif;
}
.csb-dual input::placeholder { color: #b8b6d4; }
.csb-sr {
position: absolute !important;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0, 0, 0, 0);
white-space: nowrap;
border: 0;
}
More from 32 CSS Search Box & Search Bar Designs
Clear-on-TypeKeyboard HintAnimated PlaceholderAvatar SearchBrutalist StampCompact ToolbarHero SearchSide IndicatorDrop Shadow FloatSearch + FilterGlitch SearchCompact Mobile
View the full collection →