【发布时间】:2014-08-14 19:06:48
【问题描述】:
这里是一些示例代码http://jsfiddle.net/XpLSZ/2/
<div class="main">
<div class="item ">
<img class ="icon" src="https://www.google.com/s2/favicons?domain=http://planet.clojure.in"/>
<span class="title" >This is a test Long title</span>
<span class="count" >(22)</span>
</div>
</div>
.main{
border-style: solid;
border-width: medium;
width:200px;
}
.icon{
width:12px;
height:12px;
}
.truncate {
width: 100%;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
我想要的是有一行 icon.title 和 count 并且标题被截断而不是换行,这可以用 css 吗? (我不希望 count 被截断) 现在我在 JS 中做了一些截断,但问题是布局在某些浏览器中是不同的,而且它在某些缩放级别上会刹车。
【问题讨论】: