是不是“文本溢出:省略号”有效的CSS?

前端之家收集整理的这篇文章主要介绍了是不是“文本溢出:省略号”有效的CSS?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
代码在运行 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:省略号是一个有效的规则,但遗憾的是W3C CSS验证器容易出错(见 bug list).

但请注意,当前工作草案将一些文本溢出值列为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.

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

Parse Error [empty string]

参考

> W3C:CSS基本用户界面模块3级(CSS3 UI):( WD-20120117)

> Features at risk
> 8.2. Overflow Ellipsis: the ‘text-overflow’ property

原文链接:https://www.f2er.com/css/215102.html

猜你在找的CSS相关文章