CSS :autofill pseudo-class

Definition and usage

CSS :autofill The pseudo-class is used to select and set the style of the <input> element automatically filled by the browser: <input> Element style.

If the user edits the automatically filled field, this pseudo-class will stop working.

Example

Select and set the style of the <input> element automatically filled by the browser:

input:autofill {
  border: 2px solid salmon;
}

Try it yourself

CSS syntax

:autofill {
  css declarations;
}

Technical details

Version: CSS2

Browser support

The numbers in the table specify the first browser version that fully supports the pseudo-class.

Chrome Edge Firefox Safari Opera
110 110 86 15 96

Related pages

Tutorial:CSS Forms