coderef

:autofillLimited availability

The :autofill pseudo-class matches <input> elements that have been filled in automatically by the browser.

Not yet supported in all major browsers — check the table and provide a fallback.

Browser support

DesktopChrome
1–109Not supported
110+Supportedsince Feb 7, 2023
Current: 155
Edge
12–109Not supported
110+Supportedsince Feb 9, 2023
Current: 154
Firefox
✕Not supportedup to 157
Current: 157
Safari
1–14.1Not supported
15+Supportedsince Sep 20, 2021
Current: 27
MobileChrome Android
18–109Not supported
110+Supportedsince Feb 7, 2023
Current: 155
Firefox Android
✕Not supportedup to 157
Current: 157
Safari iOS
1–14.5Not supported
15+Supportedsince Sep 20, 2021
Current: 27

How to use

Not supported in Firefox, Firefox Android. Use feature detection below and provide a fallback (or a polyfill) for those browsers.

Example

Full syntax and examples are on MDN: :autofill.

Feature detection

CSS · check before using
@supports selector(:autofill) {
  /* styles that use :autofill */
}

/* or in JavaScript */
if (CSS.supports("selector(:autofill)")) {
  // use it
}