未解决的情况下,自动填充导致样式非设定样式:

解决后效果图:

image.png

css解决方案:

input:-webkit-autofill,
input:-webkit-autofill:hover, 
input:-webkit-autofill:focus, 
input:-webkit-autofill:active {
    -webkit-text-fill-color: #f1f1f0 !important;
    -webkit-background-clip: text !important;
    caret-color: #ffffff !important;
    transition: background-color 5000s ease-in-out 0s !important;
}

其中直接覆盖还原文本颜色、裁剪方案、光标颜色。

过度设定详解:

  • background-color:指定要过渡的CSS属性,这里是背景颜色。
  • 5000s:表示过渡效果的持续时间,这里是5000秒(即5000秒后背景颜色才会发生变化)。
  • ease-in-out:表示过渡效果的时间函数,这里是从慢到快再到慢的过渡效果。
  • 0s:表示过渡效果的延迟时间,这里是0秒,即立即开始过渡。
  • 从而达到预期效果,暂时没发掘到更好的方案~~~~~~~~~~~~~~~~~~~~