【发布时间】:2015-01-24 01:06:10
【问题描述】:
我有以下也绑定到引导弹出窗口的 html(如果这有什么不同的话)
<div class="event" style="top: 0%; width: 100%;">
<span class="test">Layouts</span>
<div class="value">
test
</div>
<span class="test">Starts</span>
<div class="value">2014/12/12, 11:00</div>
<span class="test">Ends</span>
<div class="value">2015/1/16, 00:00</div>
</div>
与关联的 scss:
& > div.event {
// position: absolute;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
background-color: rgba(41, 128, 185,.7);
outline: 1px solid rgba(155, 89, 182,1.0);
min-height: 30px;
color: white;
// width: 100%;
height: 30px;
padding: 5px;
z-index: 1;
font-size: 0.7em;
.test {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
float:left;
// text-transform: uppercase;
font-weight: 200;
padding: 0;
}
.value {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
float:left;
color: rgba(255,255,255,0.5);
margin-bottom: 5px;
i.fa-external-link {
cursor: pointer;
line-height: 23px;
}
}
.value, .test {
padding-right: 5px;
}
我的问题是,当我缩小“.event”容器(可以说是 5%)时,文本会被截断,我想将其显示为省略号。从我读过的内容来看,关键是真的要溢出:用空白隐藏:nowrap 以及 text-overflow 集。我四处游荡,将它们移动到各种元素,但似乎没有任何效果。我在做一些明显错误的事情?如果问题出现在更高级别,我可以发布更多 html 和 css。
小提琴显示问题: http://jsfiddle.net/q1go1471/2/
【问题讨论】:
-
那是 CSS 还是 SCSS?如果您可以在 jsfiddle 中重现该问题,那么获得答案可能会更快。 (jsfiddle.net)
标签: javascript jquery html css twitter-bootstrap