【发布时间】:2014-06-21 05:10:42
【问题描述】:
这里是 jsfiddle http://jsfiddle.net/DBEHJ/7/
我有一个带有标题的 div 'header' 和一个显示在 'div' 右侧(浮动:右侧)的“关闭”按钮。我正在使用 text-overflow: ellipsis 作为标题,但如果我使用它,关闭按钮(浮动:右)将不再出现。这种行为在所有浏览器中并不一致。下面是代码
<div class="header">
<span class="title">A Very Long Title</span>
<span class="closeButton"> [X] </span>
</div>
.header {
height: 49px !important;
border: 1px solid #d3d3d3;
background-color: #E5E5E5;
width: 200px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.header .title {
line-height: 50px;
margin: 20px;
font-size: 18px;
color: #444444;
}
.closeButton {
float:right;
margin: 10px;
}
感谢任何回复。
【问题讨论】:
-
感谢您的回复,会出现关闭按钮,但是当给出长标题时,标题和关闭按钮会重叠,就像jsfiddle.net/7FzCj/3 一样,我需要文本溢出才能在这种情况下工作跨度>