如何禁用CheckBox和RadioButtonList的颜色(灰色)? [英] How can I change the color(gray) of the CheckBox and RadioButtonList when it is Disabled?

查看:183
本文介绍了如何禁用CheckBox和RadioButtonList的颜色(灰色)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

input[disabled] { border:solid 1px black; background-color:White;color:black; }



这是用于更改Disable对象样式的CSS,但它仅适用于所有TEXTBOX。


This is the CSS to change teh style of the Disable object but it only works for all the TEXTBOX only.

推荐答案

http://forums.asp.net/t/1232268.aspx [ ^ ]。非常乐意谷歌为你,希望它有所帮助。
http://forums.asp.net/t/1232268.aspx[^]. More than happy to google for you, hope it helps.


没办法。例如,IE允许您设置复选框的某些属性,但

不是标记的颜色。实际上,这个颜色是否可以用CSS术语描述是否真的有问题 - 它是否真的是元素的_content_

的颜色?毕竟,< input> HTML格式中的元素是空的(即不能有任何内容)。



你可以使用复选框的图像,或者你可以通过使用带有不间断空格的元素或

a复选标记字符作为唯一内容并具有合适的边框,构建一个类似于
复选框的外观。 />
但是不能保证这些对应于用户浏览器中

a复选框的外观。此外,几种常用字体中没有复选标记字符





为什么首先使用禁用的复选框? ?它基本上是

仅在页面中通过

客户端脚本更改内容时才有用,因此可以禁用复选框或正常使用

,具体取决于页面状态。但在这种情况下,它应该看起来很像

就像残疾人一样。



让我猜...我读过关于需要

的一些规则和规定,当表格被回应确认时,它必须看起来与原始表格完全一样,但你自然不想让用户更改

内容。问题是由相当人为的规则造成的,并且没有可靠的解决方案,但是我会考虑使用通常可更改的字段创建一个正常的表格

_but_ check in the server

没有更改的脚本(这对于数据安全来说是一个有用的检查)。
No way. For example, IE lets you style some properties of check boxes but
not the color of the mark. It's actually questionable whether that color
is describable in CSS terms at all - is it really color of the _content_
of the element? After all, <input> elements are empty (i.e. cannot have
any content) in HTML terms.

You might use an image of a checkbox, or you could construct a
checkbox-like appearance by using a element with no-break space or
a check mark character as the only content and with a suitable border.
But there's no guarantee that these would correspond to the appearance of
a checkbox in the user's browser. Besides, the check mark character
is not present in several commonly used fonts.

Why would you use a disabled checkbox in the first place? It's basically
useful only in the case of a page where the content is changed via
client-side scripting, so that a checkbox can be disabled or normal
depending on the state of the page. But in that case, it should look very
much like disabled when it is.

Let me guess... I've read about some rules and regulations that require
that when a form is echoed for confirmation, it must look exactly like
the original form, but you naturally don't want to let users change the
content. The problem has been created by rather artificial rules, and
there is no reliable solution, but I would consider creating a normal form
with normally changeable fields _but_ check in the server-side script that
nothing was changed (which is a useful check, for data security, anyway).


这篇关于如何禁用CheckBox和RadioButtonList的颜色(灰色)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆