在保持功能的同时隐藏单选按钮 [英] Hide radio button while keeping its functionality

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

问题描述

我搜索了SO和Google,但找不到任何相关的内容。有没有什么办法可以隐藏图像旁边的单选按钮(用作标签),但在点击标签时仍然保持其功能?

I searched on SO and Google and I couldn't find anything related. Is there any way I can hide the radio button next to an image (that is used as a label for it) but still keep its functionality when clicking on the label?

我尝试了几种方法,但似乎使用 display:none visibility:hidden 会使radio功能失效。 / p>

I have tried several methods but it seems that using display:none or visibility:hidden makes the radio function useless.

推荐答案

使用另一个与背景颜色相匹配的div覆盖它们。这将隐藏单选按钮,而您的单选按钮仍然可以在点击标签时使用。希望这有助于..

Just cover them with another div whose color matched with the background. This will hide the radio buttons and still your radio buttons will work on clicks of their labels. Hope that helps..

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

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