如何在IE中使用第n个孩子

时间:2014-08-13 10:48:37

标签: css asp.net c#-4.0 gridview lightbox

我有一个网格视图,其中我正在显示我的图像。 现在我使用css nth child隐藏除了第一行网格视图之外的所有行,这样当我点击链接时,图像的幻灯片开始

对于幻灯片放映我正在使用灯箱。

第n个chlid代码就像这样

<style type="text/css">
    table.Grid tr:nth-child(n + 3) {
        display: none;
    }
</style>

并在我的网格视图中使用该css

<asp:GridView runat="server" CssClass="Grid">
    <%--My templates here--%>
</asp:GridView>

现在在crome和mozila工作正常,但在IE中我怎么能在IE或任何其他东西中使用它只显示第一行并隐藏其他行而我想隐藏行不想让它们看不见

任何帮助都是适用的...... !!!更多你可以看到我以前的问题

Previous Question

1 个答案:

答案 0 :(得分:1)

nth-child仅适用于ie9 + - 请参阅http://caniuse.com/#feat=css-sel3

此外,nth-child(n + 3)将选择每个第3个元素,而不是第一个元素。有关使用nth-child的完整指南,请参阅http://nthmaster.com/