我正在尝试对齐 2 个 div,其中右边的内容是固定的,左边的内容被截断以填充剩余空间。我找到了这个 How to place two divs side by side where one sized to fit and other takes up remaining space? (在这里 fiddle http://jsfiddle.net/ssawchenko/gKnuY/ )这很接近,但我希望正确的 div 不要向右浮动,所以如果文本足够小以适合并排显示文本。这可能吗?
最佳答案
在上面这样做似乎是一种疯狂的方式。告诉这是否是您想要的:http://jsfiddle.net/joplomacedo/gKnuY/404/
CSS:
.fixed {
float:right;
width: 200px;
}
.fluid {
margin-right: 200px; /* same as fixed's width */
}
html:
<div class="fixed"></div>
<div class="fluid"></div>
关于html - 对齐 2 个 div,其中右侧内容的大小适合,左侧内容被截断,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12540344/