::checkmark CSS pseudo-element

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

The ::checkmark CSS pseudo-element targets the checkmark placed inside the currently-selected <option> element of a customizable select element. It can be used to provide a visual indication of which option is selected.

Try it

<label for="pet-select">
  Select pet:
</label>
<br>
<select id="pet-select">
  <option value="cat">Cat</option>
  <option value="dog">Dog</option>
  <option value="chicken">
    Chicken
  </option>
</select>
option::checkmark {
  color: orange;
  font-size: 1.5rem;
}

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

select {
  border: 2px solid #dddddd;
  background: #eeeeee;
  padding: 10px;
}

::picker(select) {
  border: none;
}

option {
  border: 2px solid #dddddd;
  background: #eeeeee;
  padding: 10px;
}

option:first-of-type {
  border-radius: 8px 8px 0 0;
}

option:last-of-type {
  border-radius: 0 0 8px 8px;
}

option:nth-of-type(odd) {
  background: white;
}

option:not(option:last-of-type) {
  border-bottom: none;
}

Syntax

css
::checkmark {
  /* ... */
}

Description

The ::checkmark pseudo-element targets the checkmark placed inside a customizable select element's currently-selected <option>.

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 before any boxes generated by the ::before pseudo-element. The icon can be customized using the content property.

The ::checkmark selector is useful for example if you want to hide the checkmark, use a custom icon, or adjust the checkmark's rendering position inside <option> elements.

Note: The ::checkmark 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

Customizing the checkmark

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:

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

Assuming flexbox is being used to lay out the <option> elements (which is true in current implementations of customizable selects), you could then move the checkmark from the start of the row to the end by setting an order value on it greater than 0, and aligning it to the end of the row using an auto margin-left value (see Alignment and auto margins).

The value of the content property could also be set to a different emoji to change the displayed icon.

css
option::checkmark {
  order: 1;
  margin-left: auto;
  content: "☑️";
}

See Styling the current selection checkmark for a full example that uses this code, along with a live example rendering.

Specifications

Specification
CSS Form Control Styling Level 1
# checkmark

Browser compatibility

desktop mobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
::checkmark
Experimental
Chrome – Full support
Chrome 133 (Release date: 2025-02-04)
footnote Full support
Edge – Full support
Edge 133 (Release date: 2025-02-06)
footnote Full support
Firefox – No support
Firefox
footnote No support
Opera – Full support
Opera 118 (Release date: 2025-04-15)
footnote Full support
Safari – No support
Safari
footnote No support
Chrome Android – Full support
Chrome Android 133 (Release date: 2025-02-04)
footnote Full support
Firefox for Android – No support
Firefox for Android
footnote No support
Opera Android – Full support
Opera Android 88 (Release date: 2025-03-19)
footnote Full support
Safari on iOS – No support
Safari on iOS
footnote No support
Samsung Internet – Full support
Samsung Internet 29 (Release date: 2025-10-25)
footnote Full support
WebView Android – Full support
WebView Android 133 (Release date: 2025-02-04)
footnote Full support
WebView on iOS – No support
WebView on iOS
footnote No support

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support
Experimental. Expect behavior to change in the future.

See also