jquery - 用于旧浏览器的 jquery 中的第 nth-child(4n)

标签 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-child(4n)").css('margin-right', '0px !important');

关于jquery - 用于旧浏览器的 jquery 中的第 nth-child(4n),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19283505/

相关文章:

wordpress - 在哪里可以找到在本地使用 WordPress 创建的网站

php - Wordpress 时间线每季度添加标题 1 月至 3 月等等

javascript - 使用 AngularJS 的动态 URL

html - ASP RadioButtonList 元素下方内联

javascript - 当用户滚动回页面顶部时,如何使 Logo 效果恢复为 "normal"?

javascript - 关于固定 header 的 jQuery + CSS : How to scroll smooth,?

html - Wordpress 列数排序

javascript - 使用延迟和何时

javascript - jquery从字符串中提取数据

javascript - 提交文件而不刷新页面