L o a d i n g . . .
主打一个C++
文章详情

html解决表单自动填充后的背景色,字体颜色等被修改情况

Posted on 2022-01-13 19:28:54 by 主打一个C++

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

错误示范.png

解决后效果图:

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秒,即立即开始过渡。
  • 从而达到预期效果,暂时没发掘到更好的方案~~~~~~~~~~~~~~~~~~~~

*转载请注明出处:原文链接:https://cpp.vin/page/125.html

作者近期文章
  • 随手笔记
  • 主打一个C++   2025-01-11 20:02:01
  • 都2000000025年了。还有不能随意访问guthub的,仔细看。在国内其实是可以正常访问的,gfw并没屏蔽。这里给出其中一个简单直接的方法稳定访问。1. 随便百度一个”dn
提示
×
确定
数据库执行: 8次 总耗时: 0.01s
页面加载耗时: 



wechat +447752296473
wechat cpp-blog