[英]How to hide all checkboxes using CSS
How can I hide all checkboxes at once using CSS? 如何使用CSS一次隐藏所有复选框?
As of now I have the following: 到目前为止,我有以下内容:
#checkbox
{
display:none
}
But this isn't working / being applied. 但这是行不通的。
You can do it by using a selector, by element and type: 您可以通过使用选择器,按元素和类型来实现:
input[type="checkbox"]
{
display:none;
}
It works,test is the class name for div. 它有效,test是div的类名。
.test input[type="checkbox"] {
display: none;
}
This should work 这应该工作
<style type="text/css">
.checkboxs{
display:none;
}
</style>
<form>
<input class="checkboxs" type="checkbox" name="vehicle" value="Bike" /> I have a bike<br />
<input class="checkboxs" type="checkbox" name="vehicle" value="Car" /> I have a car
</form>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.