微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

是不是“文本溢出:省略号”有效的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.jb51.cc/css/215102.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。