如何防止在调整大小时换行?
<div class="wrapper">
<div class="left">Left Left Left Left Left Left Left Left Left Left </div>
<div class="right">Right Right Right Right Right Right Right Right Right</div>
</div>
无论设置什么窗口宽度,我都希望两个 div 并排...
.wrapper {
max-width: 990px;
width: 100%;
margin: 0 auto;
background-color: cornflowerblue;
}
.left {
float: left;
}
.right {
float: right;
}
https://jsfiddle.net/m5d9jkxq/
谢谢!
最佳答案
省略号对你有用吗?
CSS:
.wrapper {
max-width: 990px;
width: 100%;
margin: 0 auto;
background-color: cornflowerblue;
}
.left {
float: left;
white-space:nowrap;
text-overflow:ellipsis;
overflow:hidden;
width:50%
}
.right {
float: right;
white-space:nowrap;
text-overflow:ellipsis;
overflow:hidden;
width:50%;
}
关于html - 如何防止调整大小时换行?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30690199/