我不知道如何增加或者使用默认字体大小来预览浏览器自动完成建议时的文本。
我正在使用 https://tailwindcss.com/ 来处理所有样式。
例如:
这是我的普通输入元素,在输入一些文本后的默认字体大小:
而这是我悬停在建议自动完成项目上时预览文本的字体大小:
正如您所看到的,第二张图中字体大小比第一张小得多。
我已经使用了一些CSS代码片段来禁用所有特定于浏览器的样式:
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
textarea:-webkit-autofill:hover,
textarea:-webkit-autofill:focus,
select:-webkit-autofill,
select:-webkit-autofill:hover,
select:-webkit-autofill:focus {
border: inherit;
-webkit-text-fill-color: inherit;
-webkit-box-shadow: inherit;
transition: background-color 5000s ease-in-out 0s;
font-size: inherit;
}
最后一个属性font-size
没有任何作用。
我正在使用以下CSS来设置输入框的字体大小:
font-size: 1.125rem !important;
我也尝试将字体大小作为内联样式分配以解决问题,但它并不起作用:
示例链接:https://codesandbox.io/s/o766kp4z05 使用该示例并尝试在电子邮件字段中输入您的电子邮件并查看字体大小。 它与字体大小存在相同的问题。
是否有可能修复字体大小问题?