【问题标题】:Unknown pseudo-element or pseudo-class :last未知的伪元素或伪类 :last
【发布时间】:2015-04-28 05:44:36
【问题描述】:

我在我的项目中使用 HTML5 和 CSS3。在使用 W3C 验证器验证我的 CSS 时,我收到以下错误,说

未知的伪元素或伪类:last

.point:last {
    margin: 0 !important;
}

我该如何解决这个问题。

【问题讨论】:

  • 不知道你的标记?使用 jQuery。

标签: css


【解决方案1】:

:last 不存在。

只需 :last-child:last-of-type:nth-last-child:nth-last-of-type

【讨论】:

【解决方案2】:

:last 不是伪元素,:last-child 或 :nth:last-child 这些是但 :last child pseudo 不受旧版本的 IE 支持,因此使用 :first-child:nth-first-child 总是更好的方法这是一个很好的做法。

【讨论】:

    猜你喜欢
    • 2011-03-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-06-24
    • 2021-10-16
    • 2011-01-22
    • 1970-01-01
    相关资源
    最近更新 更多