Default dropdown
<select>
<option>Cherry</option>
<option>Mango</option>
<option selected>Banana</option>
…
</select>
Test sheet · 164 specimens · 13 sections
Every way CSS can restyle a <select>, one technique per card, drawn by whichever browser opens this page. Each card prints the exact CSS it applies. Cards tagged open to see or similar need that interaction before the screenshot.
No author CSS. The reference for everything below.
Show only this sectionShow all sections<select>
<option>Cherry</option>
<option>Mango</option>
<option selected>Banana</option>
…
</select>
<optgroup label="Tropical fruit">
<option>Mango</option> …
</optgroup>
<option>Banana</option>
<hr>
<option>Papaya</option>
<select disabled>
<select size="4">
<select multiple>
Two options are selected.
<select multiple size="1">
A multi-select popup where the browser has one. A one-row listbox elsewhere.
<select size="9">
<optgroup label="Stone fruit">
<option disabled>Apricot</option>
<option>Dragon fruit (white-fleshed pitahaya)</option>
The width follows the widest option, not the selected one.
<option value="" disabled selected hidden>
Choose a fruit…
</option>
<input> <select> <button>
Default heights, fonts and baselines side by side.
The switch between the platform control and a box that CSS draws.
Show only this sectionShow all sectionsselect {
-webkit-appearance: auto;
appearance: auto;
}
select {
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
}
The arrow goes with the native look. Section E puts one back.
select {
-webkit-appearance: menulist;
appearance: menulist;
}
select {
-webkit-appearance: menulist-button;
appearance: menulist-button;
}
select {
-webkit-appearance: textfield;
appearance: textfield;
}
select {
-webkit-appearance: button;
appearance: button;
}
select {
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
}
select {
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
}
select {
all: unset;
}
Removes the UA stylesheet rules as well as the native look.
One property per card with appearance left alone. Shows which properties make an browser drop its native look.
Show only this sectionShow all sectionsselect {
color: #d6336c;
}
select {
background-color: #ffe066;
}
select {
background-image: linear-gradient(#ffffff, #b9c6d6);
}
select {
border: 2px solid #d6336c;
}
select {
border-radius: 999px;
}
select {
border: 2px solid #1d2733;
border-radius: 12px;
}
select {
border: 0;
}
select {
background: none;
}
select {
padding: 12px 24px;
}
select {
height: 56px;
}
select {
line-height: 3;
}
select {
width: 100%;
}
select {
width: 7em;
}
The selected text is longer than the box.
select {
box-shadow: 4px 4px 0 #d6336c;
}
select {
outline: 3px dashed #2f6fed;
outline-offset: 3px;
}
select {
opacity: .4;
}
select {
filter: invert(1) hue-rotate(180deg);
}
An old way to fake a dark control.
A select ignores its parent font and colour unless told to inherit them.
Show only this sectionShow all sections.parent {
font: italic 20px Georgia, serif;
color: #d6336c;
}
select.b {
font: inherit;
color: inherit;
}
First control: the UA font and colour. Second: inherited from the parent.
select {
font-family: Georgia, "Times New Roman", serif;
}
.s { font-size: 11px; }
.m { font-size: 16px; }
.l { font-size: 28px; }
select {
font-weight: 700;
}
select {
font-style: italic;
}
select {
font-variant: small-caps;
}
select {
letter-spacing: .25em;
}
select {
text-transform: uppercase;
}
select {
text-decoration: underline wavy #d6336c;
}
select {
text-shadow: 2px 2px 0 #d6336c;
}
select {
width: 14em;
text-align: center;
}
select { width: 14em; }
.a { text-align: right; }
.b { text-align-last: right; }
select {
text-indent: 2em;
}
select {
direction: rtl;
}
The arrow should move to the left.
select {
width: 9em;
white-space: normal;
}
Tests whether long selected text wraps.
select {
width: 9em;
text-overflow: ellipsis;
}
select {
writing-mode: vertical-rl;
}
select {
writing-mode: vertical-lr;
text-orientation: upright;
}
appearance: none takes the arrow away. Each card puts one back a different way.
Show only this sectionShow all sectionsselect {
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
margin: 0;
padding: 9px 40px 9px 12px;
font: 16px/1.25 system-ui, sans-serif;
color: #1d2733;
background-color: #fff;
border: 1px solid #8794a3;
border-radius: 6px;
}
E02 to E12 all add to this rule.
/* added to E01 */
select {
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%231d2733' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='m3 6 5 5 5-5'/%3E%3C/svg%3E");
background-repeat: no-repeat;
background-position: right 12px center;
background-size: 16px 16px;
}
/* added to E01 */
select {
background-image:
linear-gradient(45deg, transparent 50%, #1d2733 50%),
linear-gradient(135deg, #1d2733 50%, transparent 50%);
background-position:
calc(100% - 19px) 50%,
calc(100% - 13px) 50%;
background-size: 6px 6px;
background-repeat: no-repeat;
}
No image at all, so the arrow can use currentColor.
<span class="wrap">
<select>…</select>
</span>/* added to E01 */
.wrap {
position: relative;
display: inline-block;
}
.wrap::after {
content: "";
position: absolute;
right: 14px;
top: 50%;
margin-top: -3px;
border: 6px solid transparent;
border-top-color: #1d2733;
border-bottom: 0;
pointer-events: none;
}
/* added to E01 */
.wrap {
position: relative;
display: inline-block;
}
.wrap::after {
content: "\25BE";
position: absolute;
right: 14px;
top: 50%;
transform: translateY(-50%);
font-size: 18px;
line-height: 1;
color: #1d2733;
pointer-events: none;
}
U+25BE. The glyph comes from whichever font the platform picks.
/* added to E01 */
.wrap {
position: relative;
display: inline-block;
}
.wrap::after {
content: "";
position: absolute;
right: 16px;
top: 50%;
width: 7px;
height: 7px;
margin-top: -7px;
border-right: 2px solid #1d2733;
border-bottom: 2px solid #1d2733;
transform: rotate(45deg);
pointer-events: none;
}
/* added to E01 */
.wrap {
display: inline-grid;
grid-template-areas: "select";
align-items: center;
}
.wrap select,
.wrap::after {
grid-area: select;
}
.wrap::after {
content: "";
justify-self: end;
width: 12px;
height: 7px;
margin-right: 14px;
background-color: #1d2733;
clip-path: polygon(100% 0%, 0 0%, 50% 100%);
pointer-events: none;
}
/* added to E01 */
.wrap {
position: relative;
display: inline-block;
color: #d6336c;
}
.wrap select {
color: inherit;
border-color: currentColor;
}
.wrap::after {
content: "";
position: absolute;
right: 12px;
top: 50%;
width: 16px;
height: 16px;
margin-top: -8px;
background-color: currentColor;
-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='m3 6 5 5 5-5'/%3E%3C/svg%3E") center / contain no-repeat;
mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='m3 6 5 5 5-5'/%3E%3C/svg%3E") center / contain no-repeat;
pointer-events: none;
}
Arrow, text and border all follow one colour.
/* added to E01 */
select {
padding-right: 54px;
background-image:
url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='m3 6 5 5 5-5'/%3E%3C/svg%3E"),
linear-gradient(#2f6fed, #2f6fed);
background-repeat: no-repeat;
background-position: right 13px center, right center;
background-size: 16px 16px, 42px 100%;
}
/* added to E01 */
select {
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%231d2733' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round' d='m4.5 6 3.5-3.5L11.5 6M4.5 10 8 13.5 11.5 10'/%3E%3C/svg%3E");
background-repeat: no-repeat;
background-position: right 12px center;
background-size: 16px 16px;
}
/* added to E01 */
select {
padding: 9px 12px 9px 40px;
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%231d2733' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='m3 6 5 5 5-5'/%3E%3C/svg%3E");
background-repeat: no-repeat;
background-position: left 12px center;
background-size: 16px 16px;
}
/* added to E01 */
/* IE 10 and 11, EdgeHTML */
select::-ms-expand {
display: none;
}
/* Firefox before 35 */
select {
text-indent: 0.01px;
text-overflow: "";
}
No effect in current browsers. Kept for screenshots of old ones.
Finished looks built from the techniques above, each with its full CSS.
Show only this sectionShow all sectionsselect {
-webkit-appearance: none;
appearance: none;
padding: 6px 38px 6px 12px;
font: 16px/1.5 system-ui, sans-serif;
color: #1d2733;
background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%235c6b7a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='m3 6 5 5 5-5'/%3E%3C/svg%3E") no-repeat right 11px center / 16px 16px;
border: 1px solid #b6c0cb;
border-radius: 6px;
}
select:hover {
border-color: #5c6b7a;
}
select:focus-visible {
outline: none;
border-color: #2f6fed;
box-shadow: 0 0 0 4px rgba(47, 111, 237, .25);
}
select {
-webkit-appearance: none;
appearance: none;
min-width: 13em;
padding: 14px 40px 12px 14px;
font: 16px/1.5 system-ui, sans-serif;
color: #1d2733;
background: #dfe5ec url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%231d2733' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='m3 6 5 5 5-5'/%3E%3C/svg%3E") no-repeat right 12px center / 16px 16px;
border: 0;
border-bottom: 2px solid #5c6b7a;
border-radius: 6px 6px 0 0;
}
select:focus-visible {
outline: none;
background-color: #d3e0f8;
border-bottom-color: #2f6fed;
}
select {
-webkit-appearance: none;
appearance: none;
min-width: 12em;
padding: 6px 28px 6px 0;
font: inherit;
color: inherit;
background-color: transparent;
background-image:
linear-gradient(45deg, transparent 50%, currentColor 50%),
linear-gradient(135deg, currentColor 50%, transparent 50%);
background-position: calc(100% - 11px) 50%, calc(100% - 5px) 50%;
background-size: 6px 6px;
background-repeat: no-repeat;
border: 0;
border-bottom: 2px solid currentColor;
border-radius: 0;
}
Font and colour come from the parent, so it follows the page theme.
select {
-webkit-appearance: none;
appearance: none;
padding: 8px 36px 8px 16px;
font: 600 14px/1.2 system-ui, sans-serif;
color: #fff;
background: #2f6fed url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='m3 6 5 5 5-5'/%3E%3C/svg%3E") no-repeat right 12px center / 14px 14px;
border: 0;
border-radius: 999px;
}
option {
color: #1d2733;
background-color: #fff;
}
The option rule stops white text landing on a white popup.
select {
-webkit-appearance: none;
appearance: none;
padding: 0 1.1em 0 0;
font: inherit;
color: LinkText;
background-color: transparent;
background-image:
linear-gradient(45deg, transparent 50%, currentColor 50%),
linear-gradient(135deg, currentColor 50%, transparent 50%);
background-position: calc(100% - 5px) 55%, 100% 55%;
background-size: 5px 5px;
background-repeat: no-repeat;
border: 0;
border-bottom: 1px dashed currentColor;
border-radius: 0;
cursor: pointer;
}
select {
-webkit-appearance: none;
appearance: none;
color-scheme: dark;
padding: 8px 40px 8px 14px;
font: 16px/1.5 system-ui, sans-serif;
color: #f1f4f7;
background: #1d2733 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23ffe066' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='m3 6 5 5 5-5'/%3E%3C/svg%3E") no-repeat right 12px center / 16px 16px;
border: 1px solid #45556a;
border-radius: 8px;
}
select {
-webkit-appearance: none;
appearance: none;
padding: 12px 44px 12px 18px;
font: 600 16px/1.25 system-ui, sans-serif;
color: #fff;
background-image:
url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='m3 6 5 5 5-5'/%3E%3C/svg%3E"),
linear-gradient(135deg, #2f6fed, #7048e8);
background-repeat: no-repeat;
background-position: right 14px center, 0 0;
background-size: 16px 16px, 100% 100%;
border: 0;
border-radius: 12px;
box-shadow: 0 6px 16px rgba(47, 111, 237, .35);
}
option {
color: #1d2733;
background-color: #fff;
}
select {
-webkit-appearance: none;
appearance: none;
padding: 8px 40px 8px 12px;
font: 700 16px/1.25 system-ui, sans-serif;
color: #1d2733;
background: #ffe066 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%231d2733' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='m3 6 5 5 5-5'/%3E%3C/svg%3E") no-repeat right 12px center / 16px 16px;
border: 2px solid #1d2733;
border-radius: 0;
box-shadow: 4px 4px 0 #1d2733;
}
select {
-webkit-appearance: none;
appearance: none;
padding: .5em 2.5em .5em .75em;
font-family: system-ui, sans-serif;
line-height: 1.25;
color: #1d2733;
background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%231d2733' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='m3 6 5 5 5-5'/%3E%3C/svg%3E") no-repeat right .75em center / 1em 1em;
border: 1px solid #8794a3;
border-radius: .375em;
}
.sm { font-size: 13px; }
.md { font-size: 16px; }
.lg { font-size: 20px; }
Every length is in em, so font-size scales the whole control.
select {
-webkit-appearance: none;
appearance: none;
padding: 7px 38px;
font: 16px/1.5 system-ui, sans-serif;
color: #1d2733;
background-color: #fff;
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cg fill='none' stroke='%235c6b7a' stroke-width='1.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='8' cy='8' r='6.25'/%3E%3Cpath d='M1.75 8h12.5M8 1.75c2.4 2.2 2.4 10.3 0 12.5M8 1.75c-2.4 2.2-2.4 10.3 0 12.5'/%3E%3C/g%3E%3C/svg%3E"), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%235c6b7a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='m3 6 5 5 5-5'/%3E%3C/svg%3E");
background-repeat: no-repeat;
background-position: left 12px center, right 11px center;
background-size: 16px 16px;
border: 1px solid #8794a3;
border-radius: 6px;
}
<span class="field">
<label for="fruit">Favourite fruit</label>
<select id="fruit">…</select>
</span>.field {
position: relative;
display: inline-block;
}
.field label {
position: absolute;
left: 13px;
top: 8px;
font: 600 11px/1 system-ui, sans-serif;
letter-spacing: .05em;
text-transform: uppercase;
color: #5c6b7a;
pointer-events: none;
}
.field select {
-webkit-appearance: none;
appearance: none;
min-width: 14em;
padding: 24px 40px 8px 12px;
font: 16px/1.25 system-ui, sans-serif;
color: #1d2733;
background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%231d2733' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='m3 6 5 5 5-5'/%3E%3C/svg%3E") no-repeat right 12px center / 16px 16px;
border: 1px solid #8794a3;
border-radius: 8px;
}
<span class="group">
<span class="addon">Fruit</span>
<select>…</select>
</span>.group {
display: inline-flex;
}
.group .addon,
.group select {
margin: 0;
padding: 8px 12px;
font: 16px/1.5 system-ui, sans-serif;
color: #1d2733;
border: 1px solid #8794a3;
}
.group .addon {
background-color: #dfe5ec;
border-right: 0;
border-radius: 6px 0 0 6px;
}
.group select {
-webkit-appearance: none;
appearance: none;
padding-right: 38px;
background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%231d2733' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='m3 6 5 5 5-5'/%3E%3C/svg%3E") no-repeat right 11px center / 16px 16px;
border-radius: 0 6px 6px 0;
}
/* no author CSS */
No author CSS. Tab to the control or click it.
select:focus-visible,
select.force {
outline: 3px solid #2f6fed;
outline-offset: 2px;
}
The second control has the same rule forced on with a class, so the state shows without interaction.
select {
padding: 6px 10px;
color: #1d2733;
background-color: #fff;
border: 2px solid #8794a3;
border-radius: 6px;
}
select:focus,
select.force {
outline: none;
border-color: #2f6fed;
box-shadow: 0 0 0 4px rgba(47, 111, 237, .3);
}
The second control has the same rule forced on with a class, so the state shows without interaction.
select {
padding: 6px 10px;
color: #1d2733;
background-color: #fff;
border: 2px solid #8794a3;
border-radius: 6px;
}
select:hover,
select.force {
background-color: #ffe066;
border-color: #1d2733;
}
The second control has the same rule forced on with a class, so the state shows without interaction.
select:disabled {
color: #5c6b7a;
-webkit-text-fill-color: #5c6b7a;
background-color: #dfe5ec;
border: 1px dashed #8794a3;
opacity: 1;
cursor: not-allowed;
}
opacity and the fill colour undo the dimming some browsers add.
<select required>
<option value="" disabled selected hidden>
Choose a fruit…
</option>select:required:invalid {
color: #8794a3;
}
option {
color: FieldText;
}
<option value="">Choose a fruit…</option>select:has(option[value=""]:checked) {
color: #8794a3;
font-style: italic;
}
option {
color: FieldText;
font-style: normal;
}
select {
padding: 6px 10px;
color: #1d2733;
background-color: #fff;
border: 2px solid #8794a3;
border-radius: 6px;
}
select:invalid {
border-color: #e03131;
}
select:valid {
border-color: #2f9e44;
}
Both are required. The first has no value yet.
select:user-invalid {
outline: 3px solid #e03131;
}
Pick a fruit, then pick the first option again.
select {
padding: 6px 10px;
border: 2px solid #8794a3;
border-radius: 6px;
}
select:has(option[value="stock"]:checked) {
color: #14532d;
background-color: #d3f9d8;
border-color: #2f9e44;
}
select:has(option[value="low"]:checked) {
color: #6b4400;
background-color: #fff3bf;
border-color: #f08c00;
}
select:has(option[value="out"]:checked) {
color: #7d1a1a;
background-color: #ffe3e3;
border-color: #e03131;
}
option {
color: #1d2733;
background-color: #fff;
}
select:open {
background-color: #ffe066;
outline: 3px solid #d6336c;
}
select:autofill {
box-shadow: 0 0 0 100px #fff3bf inset;
}
select:-webkit-autofill {
-webkit-text-fill-color: #1d2733;
box-shadow: 0 0 0 100px #fff3bf inset;
}
Shows only after the browser fills the field from a saved address.
Drawn as listboxes so the options are in the screenshot. The last three are dropdowns to open.
Show only this sectionShow all sectionsoption {
color: #d6336c;
background-color: #fff3bf;
}
option:checked {
color: #fff;
background-color: #d6336c;
}
Many browsers paint their own selection colour over this. Click inside to compare the focused and unfocused selection.
option:checked {
color: #fff;
background: linear-gradient(#d6336c, #d6336c);
}
A gradient is an image, so the system highlight cannot replace it.
option:checked {
color: #fff;
box-shadow: 0 0 0 100px #d6336c inset;
}
option:hover {
background-color: #ffe066;
}
option:disabled {
color: #e03131;
font-style: italic;
text-decoration: line-through;
}
option {
padding: 10px 16px;
}
option {
font: italic 700 18px Georgia, serif;
}
optgroup {
color: #2f6fed;
background-color: #e7f0ff;
font-style: normal;
font-weight: 700;
}
optgroup option {
padding-left: 24px;
color: #1d2733;
background-color: #fff;
font-weight: 400;
}
option:nth-child(even) {
color: #1d2733;
background-color: #dfe5ec;
}
<option class="cherry">Cherry</option>option.cherry {
color: #c92a2a;
border-left: 10px solid #e03131;
}
option.mango {
color: #c2410c;
border-left: 10px solid #f76707;
}
option.banana {
color: #8a6100;
border-left: 10px solid #f2b705;
}
option::before {
content: "○ ";
color: #d6336c;
}
option:checked::before {
content: "● ";
}
option {
text-align: center;
}
option:default {
font-weight: 700;
text-decoration: underline;
}
Matches the option carrying the selected attribute. Pick another row and the underline should stay on Banana.
option {
margin: 4px;
padding: 6px 10px;
border: 1px solid #8794a3;
border-radius: 8px;
}
<option hidden>…</option>
<option class="gone">…</option>option.gone {
display: none;
}
Two rows should be missing. A row that names how it was hidden is a failure.
select {
width: 11em;
}
option {
white-space: normal;
}
option {
padding-left: 26px;
background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='5' fill='%23d6336c'/%3E%3C/svg%3E") no-repeat 8px center / 10px 10px;
}
select {
color: #ffe066;
background-color: #1d2733;
}
option {
color: #d6336c;
background-color: #fff3bf;
}
option:checked {
color: #fff;
background-color: #d6336c;
}
optgroup {
color: #2f6fed;
background-color: #e7f0ff;
}
option {
padding: 12px 16px;
font-size: 24px;
}
The box around the options when size or multiple is set.
Show only this sectionShow all sectionsselect {
width: 14em;
height: 9.5em;
}
select {
padding: 8px;
color: #1d2733;
background-color: #fff3bf;
border: 2px solid #1d2733;
border-radius: 12px;
}
select {
scrollbar-width: thin;
scrollbar-color: #d6336c #ffe066;
}
select::-webkit-scrollbar {
width: 14px;
}
select::-webkit-scrollbar-track {
background: #ffe066;
}
select::-webkit-scrollbar-thumb {
background: #d6336c;
border: 3px solid #ffe066;
border-radius: 7px;
}
select {
scrollbar-width: none;
}
select::-webkit-scrollbar {
display: none;
}
Twelve options in five rows. It should still scroll.
select {
field-sizing: content;
}
Where it works, the box grows to fit all twelve options.
select {
width: 100%;
height: auto;
padding: 6px;
overflow: hidden;
border: 1px solid #8794a3;
border-radius: 10px;
}
option {
display: inline-block;
margin: 2px;
padding: 6px 12px;
color: #1d2733;
background-color: #dfe5ec;
border-radius: 999px;
}
option:checked {
color: #fff;
background: linear-gradient(#2f6fed, #2f6fed);
}
inline-block options turn the listbox into chips in some browsers.
select {
direction: rtl;
}
The scrollbar should move to the left.
select {
writing-mode: vertical-rl;
}
How a select takes its width, and how it sits beside other controls.
Show only this sectionShow all sectionsselect {
field-sizing: content;
}
Same options in both. Where it works, each is as wide as its selected text.
.row {
display: flex;
gap: 8px;
width: 200px;
margin-bottom: 8px;
outline: 1px dashed #8794a3;
}
.row select {
flex: 1;
}
.row.b select {
min-width: 0;
}
The dashed box is 200px wide. Row A shows the default minimum; row B lets the select shrink.
.box {
width: 160px;
margin-bottom: 8px;
outline: 1px dashed #8794a3;
}
.box.b select {
max-width: 100%;
}
The dashed box is 160px wide.
select {
width: 10em;
padding: 10px;
border: 2px solid #8794a3;
}
.content { box-sizing: content-box; }
.border { box-sizing: border-box; }
.z {
zoom: 1.5;
}
.t {
margin: 8px 0;
transform: scale(1.5);
transform-origin: 0 50%;
}
input,
select,
button {
box-sizing: border-box;
margin: 0;
padding: 8px 12px;
font: 16px/1.5 system-ui, sans-serif;
border: 1px solid #8794a3;
border-radius: 6px;
vertical-align: middle;
}
.reset select {
-webkit-appearance: none;
appearance: none;
}
Same box rules on all three. The second row also removes the native look from the select.
color-scheme, system colours and the preference media queries.
Show only this sectionShow all sectionsselect {
color-scheme: light;
}
select {
color-scheme: dark;
}
select {
color-scheme: light dark;
}
Follows the operating system, whatever this page is set to.
select {
color-scheme: dark;
}
select {
-webkit-appearance: none;
appearance: none;
padding: 6px 10px;
color: FieldText;
background-color: Field;
border: 2px solid ButtonBorder;
border-radius: 6px;
}
option:checked {
color: SelectedItemText;
background-color: SelectedItem;
}
select {
-webkit-appearance: none;
appearance: none;
color-scheme: light dark;
padding: 6px 10px;
color: light-dark(#1d2733, #ffe066);
background-color: light-dark(#fff3bf, #1d2733);
border: 2px solid light-dark(#1d2733, #ffe066);
border-radius: 6px;
}
select {
accent-color: #d6336c;
}
Tests whether the accent reaches a select at all.
select {
-webkit-appearance: none;
appearance: none;
padding: 6px 10px;
color: #1d2733;
background-color: #fff;
border: 2px solid #1d2733;
border-radius: 6px;
}
@media (prefers-color-scheme: dark) {
select {
color: #ffe066;
background-color: #1d2733;
border-color: #ffe066;
}
}
select {
-webkit-appearance: none;
appearance: none;
padding: 6px 10px;
color: #1d2733;
background-color: #e7f0ff;
border: 2px solid #2f6fed;
border-radius: 6px;
}
select.keep {
forced-color-adjust: none;
}
@media (forced-colors: active) {
select.adapt {
border-color: Highlight;
}
}
Differs only in a forced colours mode such as Windows High Contrast. The second control keeps its author colours.
select {
padding: 6px 10px;
border: 1px solid #b6c0cb;
border-radius: 6px;
}
@media (prefers-contrast: more) {
select {
border: 3px solid #000;
}
}
Rules that only show a difference on phones and tablets.
Show only this sectionShow all sections.small { font-size: 13px; }
.safe { font-size: 16px; }
iOS Safari zooms the page when a control under 16px takes focus.
select {
min-width: 44px;
min-height: 44px;
}
select {
-webkit-appearance: none;
appearance: none;
padding: 10px 12px;
font-size: 16px;
color: #1d2733;
background-color: #fff;
border: 1px solid #8794a3;
border-radius: 0;
}
.loud {
-webkit-tap-highlight-color: rgba(214, 51, 108, .5);
}
.off {
-webkit-tap-highlight-color: transparent;
}
select {
padding: 6px 10px;
font: 16px/1.25 system-ui, sans-serif;
}
@media (pointer: coarse) {
select {
padding: 14px 16px;
font-size: 18px;
}
}
Larger on touch screens only.
select {
display: block;
width: 100%;
min-height: 48px;
font-size: 16px;
}
appearance: base-select hands the button, picker, options, arrow and checkmark to CSS. As of November 2026: Chrome and Edge 135, Safari 27, and Firefox behind a flag. Elsewhere these cards show the native fallback.
Show only this sectionShow all sectionsselect {
appearance: base-select;
}
The picker stays native.
select,
::picker(select) {
appearance: base-select;
}
Nothing else is set: these are the browser's base styles.
select,
::picker(select) {
appearance: base-select;
}
select {
min-width: 12em;
padding: 9px 12px;
font: 16px/1.25 system-ui, sans-serif;
color: #1d2733;
background-color: #fff;
border: 1px solid #8794a3;
border-radius: 8px;
}
select:hover {
background-color: #dfe5ec;
}
select:focus-visible {
outline: 3px solid #2f6fed;
outline-offset: 2px;
}
select,
::picker(select) {
appearance: base-select;
}
select::picker-icon {
content: "▼";
color: #d6336c;
font-size: 12px;
}
select,
::picker(select) {
appearance: base-select;
}
select::picker-icon {
content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23d6336c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='m3 6 5 5 5-5'/%3E%3C/svg%3E");
width: 16px;
height: 16px;
}
select:open::picker-icon {
rotate: 180deg;
}
@media (prefers-reduced-motion: no-preference) {
select::picker-icon {
transition: rotate .2s;
}
}
select,
::picker(select) {
appearance: base-select;
}
select::picker-icon {
display: none;
}
select,
::picker(select) {
appearance: base-select;
}
::picker(select) {
margin-block: 6px;
padding: 6px;
color: #1d2733;
background-color: #fff3bf;
border: 2px solid #1d2733;
border-radius: 12px;
box-shadow: 6px 6px 0 #1d2733;
}
select,
::picker(select) {
appearance: base-select;
}
::picker(select) {
padding: 6px;
border: 1px solid #8794a3;
border-radius: 10px;
}
option {
padding: 8px 12px;
border-radius: 6px;
}
option:hover,
option:focus-visible {
color: #1d2733;
background-color: #e7f0ff;
}
option:checked {
color: #fff;
background-color: #2f6fed;
font-weight: 600;
}
option:disabled {
color: #8794a3;
text-decoration: line-through;
}
select,
::picker(select) {
appearance: base-select;
}
option::checkmark {
content: "●";
order: 1;
margin-inline-start: auto;
color: #d6336c;
}
select,
::picker(select) {
appearance: base-select;
}
option::checkmark {
display: none;
}
option:checked {
font-weight: 700;
}
<select>
<option>
<svg viewBox="0 0 16 16" width="16" height="16" fill="#e03131" aria-hidden="true"><circle cx="8" cy="8" r="6"/></svg>
<span>Cherry</span>
<small>sold by the punnet</small>
</option>
…
</select>select,
::picker(select) {
appearance: base-select;
}
option {
gap: 10px;
padding: 8px 12px;
}
option svg {
flex: none;
}
option small {
margin-inline-start: auto;
padding-inline-start: 16px;
font-size: 12px;
opacity: .7;
}
Without support the tags are dropped and each option reads as plain text.
<select>
<button>
<selectedcontent></selectedcontent>
</button>
<option>
<svg viewBox="0 0 16 16" width="16" height="16" fill="#e03131" aria-hidden="true"><circle cx="8" cy="8" r="6"/></svg>
<span>Cherry</span>
<small>sold by the punnet</small>
</option>
…
</select>select,
::picker(select) {
appearance: base-select;
}
select {
padding: 8px 12px;
border-radius: 8px;
}
selectedcontent {
display: flex;
align-items: center;
gap: 8px;
}
selectedcontent small {
display: none;
}
option {
gap: 10px;
padding: 8px 12px;
}
option small {
margin-inline-start: auto;
padding-inline-start: 16px;
font-size: 12px;
opacity: .7;
}
The button mirrors the chosen option, icon included, and hides the small print.
select,
::picker(select) {
appearance: base-select;
}
@media (prefers-reduced-motion: no-preference) {
::picker(select) {
opacity: 0;
translate: 0 -8px;
transition:
opacity .2s,
translate .2s,
display .2s allow-discrete,
overlay .2s allow-discrete;
}
::picker(select):popover-open {
opacity: 1;
translate: 0 0;
}
@starting-style {
::picker(select):popover-open {
opacity: 0;
translate: 0 -8px;
}
}
}
select,
::picker(select) {
appearance: base-select;
}
::picker(select) {
position-area: top center;
position-try-fallbacks: flip-block;
margin: 0 0 8px;
}
Opens above the button, centred on it.
select,
::picker(select) {
appearance: base-select;
}
selectedcontent {
display: flex;
align-items: center;
gap: 8px;
}
select:open::picker(select) {
display: grid;
grid-template-columns: repeat(4, 44px);
gap: 6px;
padding: 8px;
border-radius: 12px;
}
option {
justify-content: center;
width: 44px;
height: 44px;
padding: 0;
border-radius: 10px;
}
option svg {
width: 28px;
height: 28px;
}
option .name {
position: absolute;
width: 1px;
height: 1px;
overflow: hidden;
clip-path: inset(50%);
}
option::checkmark {
display: none;
}
option:checked {
outline: 3px solid CanvasText;
outline-offset: -3px;
}
selectedcontent svg {
width: 16px;
height: 16px;
}
selectedcontent .name {
position: static;
width: auto;
height: auto;
clip-path: none;
}
Colour names stay in the markup for assistive tech and for the fallback.
<optgroup label="Tropical fruit">
<legend>Tropical fruit</legend>
<option>Mango</option> …
</optgroup>
<hr>select,
::picker(select) {
appearance: base-select;
}
legend {
padding: 10px 12px 4px;
font: 700 11px/1 system-ui, sans-serif;
letter-spacing: .08em;
text-transform: uppercase;
opacity: .7;
}
optgroup option {
padding-inline-start: 12px;
}
hr {
margin: 6px 0;
border: 0;
border-top: 1px solid #8794a3;
}
select {
appearance: base-select;
}
Listbox mode arrived later than the dropdown: Chrome and Edge 145.
select {
appearance: base-select;
width: 14em;
padding: 6px;
color: #1d2733;
background-color: #fff;
border: 1px solid #8794a3;
border-radius: 10px;
}
option {
padding: 6px 10px;
border-radius: 6px;
}
option:checked {
background-color: #e7f0ff;
font-weight: 600;
}
option::checkmark {
content: "✓";
color: #2f6fed;
}
<select multiple size="1">select,
::picker(select) {
appearance: base-select;
}
The newest mode. Few browsers style it yet.
/* 1. Every browser */
select {
-webkit-appearance: none;
appearance: none;
padding: 9px 40px 9px 12px;
font: 16px/1.25 system-ui, sans-serif;
color: #1d2733;
background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%231d2733' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='m3 6 5 5 5-5'/%3E%3C/svg%3E") no-repeat right 12px center / 16px 16px;
border: 1px solid #8794a3;
border-radius: 8px;
}
/* 2. Browsers with customizable select */
@supports (appearance: base-select) {
select,
::picker(select) {
appearance: base-select;
}
select {
padding-right: 12px;
background-image: none;
}
::picker(select) {
margin-block: 6px;
padding: 6px;
color: #1d2733;
background-color: #fff;
border: 1px solid #8794a3;
border-radius: 10px;
box-shadow: 0 8px 24px rgba(29, 39, 51, .18);
}
option {
padding: 8px 10px;
border-radius: 6px;
}
option:checked {
background-color: #e7f0ff;
}
}
Looks finished in every browser; the picker improves where it can.
<select>
<button>
<selectedcontent></selectedcontent>
</button>
<option>
<svg viewBox="0 0 16 16" width="16" height="16" fill="#e03131" aria-hidden="true"><circle cx="8" cy="8" r="6"/></svg>
<span>Cherry</span>
<small>sold by the punnet</small>
</option>
…
</select>select,
::picker(select) {
appearance: base-select;
}
select {
min-width: 16em;
padding: 10px 14px;
font: 16px/1.25 system-ui, sans-serif;
color: #fff;
background-color: #1d2733;
border: 1px solid #45556a;
border-radius: 10px;
}
select:hover {
background-color: #263341;
}
select::picker-icon {
color: #ffe066;
}
select:open::picker-icon {
rotate: 180deg;
}
selectedcontent {
display: flex;
align-items: center;
gap: 10px;
}
selectedcontent small {
display: none;
}
::picker(select) {
margin-block: 6px;
padding: 6px;
color: #fff;
background-color: #1d2733;
border: 1px solid #45556a;
border-radius: 12px;
box-shadow: 0 12px 32px rgba(0, 0, 0, .35);
}
option {
gap: 10px;
padding: 9px 10px;
border-radius: 8px;
}
option:hover,
option:focus-visible {
background-color: #2d3c4d;
}
option:checked {
background-color: #2f6fed;
}
option small {
margin-inline-start: auto;
padding-inline-start: 16px;
font-size: 12px;
opacity: .75;
}
option::checkmark {
content: "✓";
order: 2;
}