gpt4 book ai didi

jquery - 无法在 IE 中使用 jQuery 为 设置 CSS

转载 作者:太空宇宙 更新时间:2023-11-04 04:53:31 25 4
gpt4 key购买 nike

这是 jQuery 代码:

$('.top:last-child').css({'color':'red'});

为了证明我尝试的选择器有效:

$('.top:last-child').hide();

它正在运行。

这是html代码

<table class="topMenu" cellpadding="0" cellspacing="0"><tr><td class="top"  id="tm_active" >
<a href="http://www.********/member.php" class="top_link"><span class="down" style="font-weight:normal;">Startpagina</span>
<!--[if gte IE 7]><!--></a><!--<![endif]-->
<div style="position:relative;display:block;"></div>
</td><td class="top" >
<a href="http://www.******/" class="top_link"><span class="down" style="font-weight:normal;">Mijn Profiel</span>
<!--[if gte IE 7]><!--></a><!--<![endif]-->
<div style="position:relative;display:block;"></div>
</td><td class="top" >
<a href="http://www.******/search.php?show=match" class="top_link"><span class="down" >Matches</span>
<!--[if gte IE 7]><!--></a><!--<![endif]-->
<div style="position:relative;display:block;"></div>
</td><td class="top" >
<a href="http://www.*******/mail.php?mode=inbox" class="top_link"><span class="down" style="font-weight:normal;">Berichten</span>
<!--[if gte IE 7]><!--></a><!--<![endif]-->
<div style="position:relative;display:block;"></div>
</td><td class="top" >
<a href="http://www.**********//" class="top_link"><span class="down" >`</span>
<!--[if gte IE 7]><!--></a><!--<![endif]-->
<div style="position:relative;display:block;"> <!--[if lte IE 6]><table id="mmm"><tr><td><![endif]-->

<!--[if lte IE 6]></td></tr></table></a><![endif]--></div>
</td></tr></table>

它在 Firefox 和 Opera 上完美运行。问题:仍然存在但已解决

最佳答案

对于这个问题,你在css代码中使用,没有使用jquery

.top:last-child{
color:red;
}

最好的问候

关于jquery - 无法在 IE 中使用 jQuery 为 <td> 设置 CSS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12931245/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com