How to prevent Chrome from changing font when autofilling username/password?

前端 未结 5 1939
情书的邮戳
情书的邮戳 2020-11-30 04:50

I have a login form with username and password inputs. In Chrome on Windows (doesn\'t happen in other browsers or on a Mac), when hovering over a saved username from the Chr

5条回答
  •  悲哀的现实
    2020-11-30 05:20

    As of now it seems that there's no way to change this in Chrome. I'd definitely call it a bug.

    However, a decent workaround is to set the font-family for all autofill-able inputs or inputs within forms that have autofill abilities to this:

    font-family: -apple-system, system-ui, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Ubuntu, Arial, sans-serif;

    This is a great cross-browser, cross-platform solution because it just takes whatever your system font is, which is exactly what Chrome seems to be doing for it's autofill font.

    It also ensures that your forms are going to have readable fonts on whatever OS your user is using.

提交回复
热议问题