-
HTML select 요소 다시 살펴보기
웹에서 select 메뉴의 스타일을 완벽하게 제어하는 방법을 알아보세요. HTML select 요소가 새로운 CSS appearance 값과 새로운 pseudo 요소로 대폭 업그레이드됩니다. select 옵션이 어떻게 HTML의 새로운 가능성을 활용하여 풍부한 콘텐츠를 포함할 수 있는지 알아보세요. 디자인 시스템에 맞는 select 요소를 빌드하는 동시에, 기본 요소의 접근성과 강력함을 모두 유지하세요.
챕터
- 0:00 - Introduction
- 2:32 - Style the select button
- 3:47 - Customize the drop-down
- 5:00 - Go beyond text options
- 6:50 - The selectedcontent element
- 7:46 - Fallback for unsupported browsers
- 8:49 - Next steps
리소스
- WebKit.org - Example website demonstrating Customizable Select
- WebKit.org - CSS Grid Lanes Field Guide
- WebKit.org – Report issues to the WebKit open-source project
- Submit feedback
관련 비디오
WWDC26
-
비디오 검색…
-
-
1:11 - Basic markup
<label for="sort-select">Sort by</label> <select id="sort-select"> <option>Newest</option> <option>Oldest</option> </select> -
2:37 - Native form control
select { } -
2:50 - appearance: base-select
body { font-family: Gill Sans, sans-serif; } select { appearance: base-select; } -
3:07 - Style the select button
select { appearance: base-select; background-color: var(--green-10); border: none; padding: 0.6em 1em; } -
3:08 - Picker icon
select:open { background-color: var(--green-100); color: white; } -
3:29 - Picker icon open state
select:open { background-color: var(--green-100); color: white; } select:open::picker-icon { content: url(icons/arrow-white.svg); } -
4:08 - Picker select
::picker(select) { } -
4:21 - Picker select spacing
::picker(select) { appearance: base-select; padding: 4px; margin-top: 0.5em; } -
4:28 - Picker select border and shadow
::picker(select) { appearance: base-select; padding: 4px; margin-top: 0.5em; border: 1px solid rgba(0,0,0,0.2); border-radius: 9px; box-shadow: 0 4px 20px rgba(0,0,0,0.2); } -
4:36 - Custom option styles
option:checked { font-weight: 600; } option:not(:checked) { color: #777; } -
4:42 - Picker option checkmark
option::checkmark { content: url(checkmark.svg); width: 0.65em; } -
5:31 - Images in option
<option value="flower"> <img src="flowers.svg" alt=""> <span class="text">Flowers</span> </option> -
5:52 - Custom option highlight
option::checkmark { display: none; } option:checked { background: #00857e; color: white; } -
6:20 - Grid layout in drop downs
::picker(select) { display: grid; grid-template: 1fr 1fr / 1fr 1fr 1fr; gap: 1rem; } -
6:43 - Select with image options
<select> <option value="anywhere"> <img src="icons/all.svg" alt=""> <span class="text">Everything</span> </option> <option value="buildings"> <img src="icons/buildings.svg" alt=""> <span class="text">Buildings</span> </option> <option value="flowers"> <img src="icons/flower.svg" alt=""> <span class="text">Flowers</span> </option> </select> -
7:11 - Select menu
<select> <option> </option> <option> </option> <option> </option> </select> -
7:13 - Select menu button
<select> <button> </button> <option> </option> <option> </option> <option> </option> </select> -
7:29 - SelectedContent Element
<select> <button> <selectedcontent></selectedcontent> </button> <option> </option> <option> </option> <option> </option> </select>
-
-
- 0:00 - Introduction
Introducing Customizable Select, a way to fully style the HTML Select Element in CSS while keeping its built-in accessibility, available in Safari 27 and Chrome 135. Follow along as a "Sort by" menu and a category picker are built to fit right into a photographer's portfolio site.
- 2:32 - Style the select button
Apply `appearance: base-select` to opt into the new styling model, then customize the button with familiar CSS — fonts, background, border, and padding. Use the new `::picker-icon` pseudo-element to swap the dropdown arrow, and the `:open` pseudo-class to change colors when the menu is showing.
- 3:47 - Customize the drop-down
Style the menu itself by applying `appearance: base-select` to the `::picker(select)` pseudo-element. Adjust spacing, borders, and box-shadow, emphasize the active option with the `:checked` pseudo-class, and replace the default checkmark using `::checkmark`.
- 5:00 - Go beyond text options
Place rich content like SVG icons, images, or labels directly inside
- 6:50 - The selectedcontent element
Replace the built-in select button by placing a
- 7:46 - Fallback for unsupported browsers
Browsers that don't support customizable select fall back to the native popup automatically — progressive enhancement just works because you're still using a semantic
- 8:49 - Next steps
Try the demo on webkit.org, experiment with customizable select in your own projects, and test against assistive tools and non-supporting browsers. To see the Grid Lanes layout used to display the photos, watch "Learn CSS Grid Lanes."