大网数据广告活动
Web 标准与前端开发

`::picker-icon` CSS pseudo-element

· 52CE 我爱测

The **`::picker-icon`** CSS pseudo-element targets the picker icon inside form controls that have an icon associated with them. In the case of a customizable select element, it selects the arrow icon shown on the `<select>` element that points down when it is closed.

The ::picker-icon CSS pseudo-element targets the picker icon inside form controls that have an icon associated with them. In the case of a customizable select element, it selects the arrow icon shown on the <select> element that points down when it is closed.

Syntax

::picker-icon {
  /* ... */
}

Description

The ::picker-icon pseudo-element targets the picker icon of form controls, that is, the icon shown on the control button. It is only available to target when the originating element has a picker and has base appearance set on it via the appearance property base-select value. Its generated box appears after any boxes generated by the ::after pseudo-element, with the icon specified in default browser stylesheet; you can customize it using the content property.

The ::picker-icon selector can be used to select the down-facing arrow on the inline-end side of a customizable select element. This is useful for example if you want to customize the color or size of the icon, use a different icon (using content or SVG), or animate it when the picker is opened and closed.

Selecting customizable <select> picker icons is the only current use case for ::picker-icon, but more may be added in the future.

[!NOTE] The ::picker-icon pseudo-element is not included in the accessibility tree, so any generated content set on it will not be announced by assistive technologies. You should still make sure that any new icon you set visually makes sense for its intended purpose.

Examples

Animating the picker icon

To opt-in to customizable select functionality, the <select> element and its picker both need to have an appearance value of base-select set on them:

select,
::picker(select) {
  appearance: base-select;
}

You could then, for example, target the ::picker-icon and give it a custom color and a transition so that changes to its rotate property are smoothly animated:

select::picker-icon {
  color: #999999;
  transition: 0.4s rotate;
}

In the next rule, ::picker-icon is combined with the :open pseudo-class — which targets the icon only when the picker is open — transitioning it to a rotate value of 180deg when the <select> is opened.

select:open::picker-icon {
  rotate: 180deg;
}

See Styling the picker icon for a full example that uses this code, along with a live example rendering.

Specifications

Browser compatibility

See also

来源:MDN Web Docs / Mozilla 贡献者 · 作者与贡献记录 · CC BY-SA 2.5。离线整理了版式、链接和媒体显示。

资料来源与适用范围

资料来源
MDN Web Docs / Mozilla 贡献者
适用范围
请按文中版本与环境说明核对
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 2.5

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。