【问题标题】:How to change just the ellipses color..ie..the 3 dots in the end of the text如何仅更改椭圆颜色..即..文本末尾的 3 个点
【发布时间】:2016-03-08 08:22:03
【问题描述】:

我有一个由数据库字段填充的列,我让它只显示省略号。文字是黑色的。

如何仅将 3 个点的颜色更改为黄色?

【问题讨论】:

标签: javascript css


【解决方案1】:

您可以使用额外的包装器来切换文本颜色:

p {
font-size:3em;/* demo */
  margin:1em;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  width:8em;
  background:#222;
  color:yellow;
  font-weight:bold;
}
span {
  font-weight:normal;
  color:white;
}
<p><span>some text to overflow</span></p>

【讨论】:

    猜你喜欢
    • 2016-02-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-03-15
    • 1970-01-01
    • 1970-01-01
    • 2012-01-21
    相关资源
    最近更新 更多