【发布时间】:2015-04-28 05:44:36
【问题描述】:
我在我的项目中使用 HTML5 和 CSS3。在使用 W3C 验证器验证我的 CSS 时,我收到以下错误,说
未知的伪元素或伪类:last
.point:last {
margin: 0 !important;
}
我该如何解决这个问题。
【问题讨论】:
-
不知道你的标记?使用 jQuery。
标签: css
我在我的项目中使用 HTML5 和 CSS3。在使用 W3C 验证器验证我的 CSS 时,我收到以下错误,说
未知的伪元素或伪类:last
.point:last {
margin: 0 !important;
}
我该如何解决这个问题。
【问题讨论】:
标签: css
:last 不存在。
只需 :last-child、:last-of-type、:nth-last-child 和 :nth-last-of-type。
【讨论】:
:last 不是伪元素,:last-child 或 :nth:last-child 这些是但 :last child pseudo 不受旧版本的 IE 支持,因此使用 :first-child 或 :nth-first-child 总是更好的方法这是一个很好的做法。
【讨论】: