此代码在所有浏览器中都能正常工作,但在 Internet Explorer 和旧版浏览器中不起作用。对于旧的浏览器和 Internet Explorer 也可以使用 jquery 来实现吗?
.post {position:relative;float:left;width:207px;height:300px;margin-right:24px}
.post:nth-child(4n) {margin-right:0px !important;}
最佳答案
可以。在 jQuery 中,尝试
$(".post:nth-child(4n)").css('margin-right', '0px !important');
关于jquery - 用于旧浏览器的 jquery 中的第 nth-child(4n),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19283505/