text-overflow:省略号在chrome 61.0.3163.100中不起作用

时间:2017-09-22 05:28:16

标签: css google-chrome

更新后无效。

CSS:

.outer {
    display:block;
    width: 100px;
    padding-top: 6px;
    font-size: 13px;
    color: #666;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
}

.inner { display: inline-block }

//添加分号

<span class="outer">
    01
    <span class="inner">|</span>
    The first step.
</span>

这是实际代码。

2 个答案:

答案 0 :(得分:1)

&#13;
&#13;
.my-elm {
  display:block;    
  padding-top: 6px;
  font-size: 13px;
  color: #666; 
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  width: 50px;
}
&#13;
<div class="my-elm">This is demo text.</div>
&#13;
&#13;
&#13;

答案 1 :(得分:0)

检查其工作情况。您在display:block

之后遗漏了分号

&#13;
&#13;
div{

    display:block;
    width: 100px;
    padding-top: 6px;
    font-size: 13px;
    color: #666;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;

    }
&#13;
<div>afewfafwfawfawfawfawfawfawfawfawefawfawfawfawfawfawfwafawfawfawfwafawfwaf</div>
&#13;
&#13;
&#13;