css - "text-overflow: ellipsis"不是有效的 CSS 吗?

标签 css w3c-validation

此代码在运行 W3C CSS Validator 时触发错误:

p{
    text-overflow: ellipsis;
}

我得到:

Line     Code context      Error/Warning
2        p                 Parse Error [empty string]

这只是验证器中的错误还是我遗漏了一些非常明显的东西?

最佳答案

这是一个 bug in the CSS validator , 已经报道过了。 text-overflow:ellipsis是一个有效的规则,但是不幸的是 W3C CSS 验证器很容易出错(参见 bug list)。

但是,请注意当前的工作草案列出了一些 text-overflow值为 feature at risk :

The Working Group has identified the following features as at risk of being removed from CSS Basic User Interface Module Level 3 when exiting CR. Implementors are urged to implement these features, if they wish to see these features remain in this specification. All other features are either defined in a normative reference (e.g. CSS 2.1 [CSS21] or Selectors [SELECT]) or are believed to have two or more implementations, and thus will not be dropped without returning to last call.

  • [...]
  • text-overflow property value: <string>
  • text-overflow property 2-value syntax and definition.

虽然这不会影响 ellipsis值,它可能是验证器中错误的来源:

Parse Error [empty string]

引用资料

关于css - "text-overflow: ellipsis"不是有效的 CSS 吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11757446/

相关文章:

jquery - 检查元素是否有显示 : none AFTER all content loads

css - IE 7 CSS 下拉菜单问题

css - 无法使高度为 : 50%

html - 带有内部媒体查询的 <link> 标签的验证问题

html - 错误 "End tag div seen, but there were open elements"

javascript - 是否可以创建一个强加 Angular 过滤器的 css 类?

css - 如何使用媒体查询增加图像的大小

html - 还有其他方法可以在 html 4.01 中的 <noscript> 标签下使用 css 文件吗?

HTML 验证错误 : Non-space characters found before DOCTYPE

php - 元素形式 : Must be non-empty 上属性操作的错误值