旧浏览器jquery中的第n个子项(4n)
此代码在所有浏览器中都可以正常工作,但在internet explorer和旧浏览器中不起作用。对于旧的浏览器和internet explorer,也可以使用jquery来实现吗旧浏览器jquery中的第n个子项(4n),jquery,css,wordpress,html,css-selectors,Jquery,Css,Wordpress,Html,Css Selectors,此代码在所有浏览器中都可以正常工作,但在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
.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实现样式?这些“帖子”是从服务器输出到页面的吗?如果是这样的话,那么直接在预期的元素上输出一个类并将该类用于样式化,而不是使用jQuery来完成,将会更容易、更轻松。