我有以下 html 和 css
<div id="car-76" class="thumbnail_car thumbnail span2">
<div class="thumbnail_creator">
<hr>
<div class="creator_img">
<img alt="Bob Smith" height="40x40" src="http://www.gravatar.com/avatar/df61dcc6eec08cb7d62f1959b89ae843?s=40&d=identicon&r=PG" width="40x40">
</div>
<div class="creator_details"> <a href="/users/2" title="John Malkovitchlongname the 3rd">
John Malkovitchlongname the 3rd
</a>
</div>
<div class="creator_followers"> <a href="/users/2/followers"><i class=" icon-eye-open" title="Followers"> </i></a> 0</div>
<div class="thumbnail_follow" id="follow_btn-2"> <a class="btn btn-primary" data-method="post" data-remote="true" rel="nofollow">Follow</a>
</div>
</div>
</div>
相关的CSS是
.thumbnail_creator .creator_details {
display: inline-block;
font-size: 77%;
position: absolute;
left: 44px;
overflow: hidden;
text-overflow: clip;
}
如果长名称到达 div 的末尾,我希望将其删除,而不是输入新行
并且由于某种原因overflow: hidden
隐藏文本和text-overflow: clip
剪辑文本不会做任何事情
所以,而不是:
我希望它是(在编辑名称以实现结果之后)