更改复选框边框颜色

发布于 2024-09-05 21:47:26 字数 52 浏览 2 评论 0原文

我可以使用 css 或 jquery 更改复选框的边框颜色吗?我只想更改复选框的边框颜色。

can i change border color of checkbox by use css or jquery. i want change only border color of check box.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

蓝天 2024-09-12 21:47:26

如果你想用纯 css 来做到这一点,你将不会得到在所有浏览器中都有效的结果。如果您使用 jqueryUI,则有一些复选框的实现,例如 this这个。否则你将不得不使用图像自己做类似的事情。

编辑:
请注意:到今天(2015年3月)这篇文章已经有大约5年历史了——当时,IE6仍然拥有大约10%的市场份额,甚至最新的IE(当时的版本8) )太糟糕了。
这个答案现在在技术上已经过时了

if you want to do this with pure css, you won't get an result that works in all browsers. if you use jqueryUI there are some implementations of checkboxes like this or this. otherwise you'll have to do something similar by yourself using images.

edit:
please note: as of today (march 2015) this post is about 5 years old - back then, the IE6 still had a market share of about 10% and even the newest IE (Version 8 at that time) was crappy as hell.
This answer is technically outdated nowadays.

尸血腥色 2024-09-12 21:47:26

复选框因呈现它们的每个浏览器的样式不同而臭名昭著。正如 Nick Craver 评论的那样,图像是安全设置复选框样式的唯一可靠方法。

Checkboxes are notorious for behaving differently to styles for each browser that renders them. As Nick Craver commented, images are the only reliable way to style checkboxes safely.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文