: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.

/* Usage 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;
}
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.

110+
86+
15+
110+
Kinsta

Your first month is free

Managed WordPress hosting for faster sites.

Learn more

New CSS drops.

Join 600+ readers who've survived clearfix hacks.

ESC