文本溢出CSS截断

问题描述:

以前我是使用JS ..动态使用JS ..但我们得到一些性能问题,我们必须提供一个替代选项。

Earlier i was doing it dynamically using JS.. but we were getting some performance issues cuz of which we have to come with an alternative option.

我现在使用文本溢出样式截断我的标签名称上的长文本。

I am now truncating a long text on my tab names using text-overflow style.

一个小问题,如果有人可以解决它

but i have a small issue if some one can resolve it

目前这是我的文本截断看起来像

currently this is how my text truncation looks like

这里的三个点(...)是黑色的,我想把它改成红色。

Here the three dots (...) comes in black colour and i want to change it to red.

有没有办法达到这个目的?

在这里工作:

  • http://jsfiddle.net/TReRs/4/

代码(HTML& CSS) / p>

Code (HTML & CSS):

<div class="overme">
    how much wood can a woodchuck chuck if a woodchuck could chuck wood?
</div>

CSS:

.overme {
    width: 300px;
    overflow:hidden; 
    white-space:nowrap; 
    text-overflow: ellipsis;
    color: red;
}

尾随点/省略号使用基本CSS以红色显示。

Trailing dots/ellipsis are colored in red using that basic CSS.