【问题标题】:Internet Explorer CSS :nth-childInternet Explorer CSS :nth-child
【发布时间】:2016-03-09 05:07:37
【问题描述】:

我在 IE 中遇到 :nth-child 的问题。 请在 IE 和 Firefox 中运行此脚本(我在 IE 11 和 Firefox 44.0.2 中进行了测试。):LINK

<div class="dropdown"> 
<select class="dropdown-select" onchange="if (this.value) window.location.href=this.value">
 <option value="#">Wybierz swoją szkółkę</option>
 <option value="http://xxx">1</option>
 <option value="http://xxx">2</option>
 <option value="http://xxx">3</option>
 <option value="http://xxx">4</option>
 <option value="http://xxx">5</option>
 <option value="http://xxx">6</option>
 </select>
</div>
        select option:nth-child(5){
            display:none;
            color:red;
        }

我想隐藏第 5 个选项。

【问题讨论】:

  • 请提供您的代码,而不仅仅是第三方网站的链接。
  • 请在 IE 和 Firefox 中运行此代码(jsfiddle)。
  • 看看stackoverflow.com/questions/2031740/…你有没有试过在没有第n个孩子的情况下在IE11中隐藏选项?
  • this。好像IE又来了!
  • Ohhhh..也是同样的问题

标签: css internet-explorer firefox parent-child


【解决方案1】:

谢谢帮助!我的解决方案:

var elem = document.getElementById("divid");
elem.parentNode.removeChild(elem);

【讨论】:

    猜你喜欢
    • 2012-05-21
    • 2013-01-22
    • 2023-03-30
    • 1970-01-01
    • 2018-07-30
    • 2012-03-14
    • 2021-11-20
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多