我想要两个相邻的文本框。第一个应该给第二个更重要的空间。我怎样才能优先考虑一个div比另一个
怎么可能不给固定的宽度和使用文本溢出:省略号放在了第一位?
例子:https://jsfiddle.net/by2e9uej/
div {
border: 1px solid black;
}
#test1 {
width: 250px;
overflow: hidden;
white-space: nowrap;
}
#test1 > div {
display: inline-block;
}
#test2 {
-o-text-overflow: ellipsis; /* Opera */
text-overflow: ellipsis; /* IE, Safari (WebKit) */
overflow:hidden; /* don't show excess chars */
white-space:nowrap; /* force single line */
vertical-align: bottom;
}
<div id="test1">
<div id="test2">long text standing in here</div>
<div id="test3">more important text in here</div>
</div>
这些被动态检索到的内容是什么? – Swellar
是的,他们不在数据库中 – naja08
给你空间是什么意思?他们是否都想留在一条线上,并且你想怎么处理溢出? – Pete