html - Bootstrap 4如何使用css通过清除按钮颜色更改来更改输入搜索
问题描述
使用搜索输入出现默认清除按钮 下面是 html 代码块
<div class="input-group search-style ">
<input id="Search" class="form-control border-secondary py-2 " type="search" placeholder="search" style="border-right: none !important;">
<div class="input-group-append">
<button class="btn removefocus" type="button" style="border-top: 1px solid gray;
border-right: 1px solid gray;
border-bottom: 1px solid gray;">
<i class="fa fa-search "></i>
</button>
</div>
</div>
清除按钮的默认颜色为蓝色。如何在我的搜索输入中更改此颜色。
解决方案
唯一的方法是将关闭图标的外观设置为无,并改用背景:
input[type="search"]::-webkit-search-cancel-button {
-webkit-appearance: none;
background: some-image or svg;
}
推荐阅读
- c# - 为什么小巧玲珑的 QuerySingleOrDefault 返回 null?
- matlab - 如何制作两个变量的分段函数的 3D 图?
- algorithm - 确定重叠线(删除它们)?
- spring - 千分尺发送指标为零 - Spring Boot
- r - 如何将数据从 PostgreSQL 数据库导入 R?
- c - 无法在 C 中打印用户定义的函数
- html - 使用angularjs在html中的表格数据单元格上显示下拉列表
- matlab - 在矩阵中查找最稀疏的行
- sql-server - 如何删除一行,其中我的一个字符串在另一个字符串内
- angularjs - 如果本地项目中存在 node_modules,则 Docker-compose 构建失败