我不能讓text-overflow: ellipsis
正常工作,我希望有人可以發現我找不到的錯誤。這裏是我的代碼:文本溢出:省略號不起作用
HTML:
<div class="out">
<div class="in1"></div>
<div class="in2">some long random text which should not fit in here</div>
</div>
CSS:
* {
box-sizing: border-box;
}
.out {
display: block;
height: 60px;
width: 250px;
border-bottom: 1px solid #eee;
cursor: pointer;
color: #000;
background: lightgreen;
}
.in1 {
height: 60px;
width: 60px;
padding: 10px;
float: left;
border: 1px solid red;
}
.in2 {
float: left;
height: 60px;
line-height: 60px;
width: 190px;
text-overflow: ellipsis;
overflow: hidden;
font-size: 1.1em;
border: 1px solid blue;
}
的jsfiddle:http://jsfiddle.net/59m5e6ex/
我發現this,但據我所知,我的div
都會召開需求。
只需添加空格:NOWRAP:您.in2類 – StefanBob
加上'白色空間:NOWRAP;'應該幫助 – Rennie