Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/90.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 如何在选中单选按钮时隐藏CSS中的文本字段_Html_Css - Fatal编程技术网

Html 如何在选中单选按钮时隐藏CSS中的文本字段

Html 如何在选中单选按钮时隐藏CSS中的文本字段,html,css,Html,Css,我想当选中单选按钮时,某些文本字段不应显示。如何在CSS或HTML中实现这一点,或者如何实现这一点?您可以这样做: html <input type="checkbox" /> <input type="input" /> 工作示例:到目前为止,您有什么经验?请提供一些代码。您很可能需要Javascript和/或JQuery。这应该可以使用相邻/同级选择器,但我们需要先查看您的代码。您到目前为止尝试的是什么。没有人会从sctrach为您编码? [type="checkb

我想当选中单选按钮时,某些文本字段不应显示。如何在CSS或HTML中实现这一点,或者如何实现这一点?

您可以这样做:

html

<input type="checkbox" />
<input type="input" />

工作示例:

到目前为止,您有什么经验?请提供一些代码。您很可能需要Javascript和/或JQuery。这应该可以使用相邻/同级选择器,但我们需要先查看您的代码。您到目前为止尝试的是什么。没有人会从sctrach为您编码?
[type="checkbox"]:checked + input {
    display: none;
}