我尝试下面的代码:如何获得CSS属性“text-overflow:ellipses”的反向行为?
#my-div{
background-color: lightblue;
display: inline-block;
width: 200px;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}
<html>
<body>
<div id="my-div">The quick brown fox jumps over the lazy dog</div>
</body>
</html>
你可能注意到了,在3点替换句子中,因为溢出的DIV的最后一部分。我怎样才能扭转这种行为?是否有可能用3个点代替句子的第一部分(即隐藏起始部分的溢出而不是结束部分)?
你可能会在这里找到一些建议:1)在左侧文本溢出省略号(HTTPS:/ /stackoverflow.com/questions/9793473/text-overflow-ellipsis-on-left-side),2)[从左边截去的溢出](https: //stackoverflow.com/questions/12761418/i-need-an-overflow-to-truncate-from-the-left-with-ellipses),和3)[反向省略号](https://hugogiraudel.com/2014/12/16/css-riddle-reverse-ellipsis /) – showdev
看看[this](http://hackingui.com/front-end/a-pure-css-solution-for-multiline-text-truncation /) –