: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

Limited availability92% global usage

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

Not ready for production without a fallback.

110+
15+
110+
ESC