我想用省略号类去掉右边多余的空格。
.ellipsis{
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
max-width: 90px;
}
div{
float:left;
}
.clear {
clear:both
}
<div class="ellipsis">hsdhhgasdhgasdgj</div><div>asdasd</div>
<div class="clear"></div>
<div class="ellipsis">asdasdasd</div><div>asdadsas</div>
发布于 2015-09-07 08:08:11
.ellipsis{
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
max-width: 90px;
float:left;
}
.clear {
clear:both
}
<div class="ellipsis">Some Text</div><div>asdasd</div>
<div class="clear"></div>
<div class="ellipsis">Some Text</div><div>asdadsas</div>
发布于 2015-08-19 23:16:36
发布于 2015-08-31 11:44:58
我想你在找这个..。
.ellipsis{
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
max-width: 90px;
float:left;
}
.clear {
clear:both
}
<div class="ellipsis">hsdhhgasdhgasdgj</div><div>asdasd</div>
<div class="clear"></div>
<div class="ellipsis">asdasdasd</div><div>asdadsas</div>
https://stackoverflow.com/questions/31982401
复制