用css隐藏检查单选按钮 [英] Hide check radio button with css

查看:153
本文介绍了用css隐藏检查单选按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否可以使用css隐藏选中的单选按钮:

I would like to know if it is possible to hide the checked radio button with css by using:

  { display:none; }

我不知道如何解决这个元素。检查的单选按钮总是显示无,这对用户来说并不意味着什么,我想隐藏它。
这是可能吗?
感谢任何指针。

I don't know how to address this element. The checked radio button always displays "none" which does not mean anything to the user and I wish to hide it. Is this possible? Thanks for any pointer.

推荐答案

Nathan Lee的补充答案

Additional to Nathan Lee answer

input[type="radio"]:checked{
    visibility:hidden;
}

是指定选中的单选按钮的选项

is an option to specify a checked radio button

input[type="radio"][value="text"]:checked{
    visibility:hidden;
}

是一个选项,用于指定一个值等于'text '(在您的示例中为'none')

is an option to specify a checked radio button with a value that equals 'text' ('none' in your example)

更多信息: https://developer.mozilla.org/en-US/docs/Web/CSS/Attribute_selectors

如果值不是知道,一些jQuery可以做的诀窍: http://api.jquery.com/attribute-equals-selector/

if the value is not know, some jQuery can do the trick: http://api.jquery.com/attribute-equals-selector/

这篇关于用css隐藏检查单选按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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