文章详情
html解决表单自动填充后的背景色,字体颜色等被修改情况
Posted on 2022-01-13 19:28:54 by 主打一个C++
未解决的情况下,自动填充导致样式非设定样式:
解决后效果图:
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秒,即立即开始过渡。
- 从而达到预期效果,暂时没发掘到更好的方案~~~~~~~~~~~~~~~~~~~~
*转载请注明出处:原文链接:https://cpp.vin/page/125.html