:autofill

Matches an input element when its value has been automatically filled by the browser (like an address or credit card). It's useful for overriding the browser's default yellow background in autofilled fields.

Quick example

input:autofill {
  /* Change the default yellow background to a subtle purple shadow */
  -webkit-box-shadow: 0 0 0px 1000px #f5f3ff inset;
  border: 1px solid #c4b5fd;
}

:autofill Browser Support

Widely available Since 2015 92% global usage

This feature is well established and works across many devices and browser versions. It has been available across browsers since 2015.

Safe to use without fallbacks.

110+
86+
15+
110+
ESC