本文介绍了Chrome 83:更改新表单样式的颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用 Chrome新更新 Chrome显示了改进的默认表单样式。
根据该帖子,我会说应该可以更改此表单主题以匹配网站的颜色设置。

With the new Chrome update Chrome is displaying improved default form styling.According to the post I would say it should be possible to change this form theme to match the color set of a website.

我花了最后几个小时进行搜索,并试图摆脱默认的蓝色,该蓝色与其余颜色的对比度非常差我的网站。除了使用'-webkit-appearance:none;'之外,我还自己重新设置了复选框之类的内容,我不确定是否有可能。

I have spend the last few hours searching and trying to get rid of the default blue color that has a very bad contrast with rest of my website. Aside from using '-webkit-appearance: none;' and restyling things like checkboxes myself I'm not sure if it's possible.

有人还会遇到此问题吗?有解决方案或文档我不见了?

Does anyone experience this issue as well or have a solution or documentation I'm missing?

推荐答案

我首选的解决方案仅使用CSS。它以Safari和Chrome为目标,但无论如何它都是灰度的,所以没关系。

My preferred solution just uses css. It targets Safari as well as Chrome, but it's already grayscale anyway, so that's OK.

input [type ='checkbox']:checked { -webkit-filter:grayscale(100%);}
input [type ='radio']:已选中{-webkit-filter:grayscale(100%);}

这篇关于Chrome 83:更改新表单样式的颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-16 06:16