如何在IE中使用css隐藏选择选项? [英] How to hide select options using css in IE?
本文介绍了如何在IE中使用css隐藏选择选项?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想隐藏选择标记的选项,下面是我编写的代码。这适用于Chrome和Firefox,但不适用于IE。
I want to hide the options for a select tag and below is the code I have written. This works well with Chrome and Firefox but not with IE.
<style>
option{
display:none !important;
}
</style>
<select style="width:400px" id="selectid" >
<option id="result1" value="Select" >Select</option>
<option disabled value="abcd" >abcd</option>
<option disabled value="abcd" >abcd</option>
<option disabled value="abcd" >abcd</option>
<option disabled value="abcd" >abcd</option>
</select>
是否有任何简单的CSS样式会隐藏它?我在stackoverflow中尝试了很多答案,但没有运气。我不想不必要地去jquery寻找简单的css东西。
Is there any simple CSS style that will hide it? I have tried many answers in stackoverflow but no luck. I don't want to unnecessarily go to jquery for a simplle css stuff.
编辑:我不希望下拉列表出现
I dont want the dropdown to appear
推荐答案
使用隐藏:
<option value="" hidden></option>
这篇关于如何在IE中使用css隐藏选择选项?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文