最佳答案
我的要求很简单: 右边有固定大小的两列。不幸的是,我找不到一个可行的解决方案,无论是在堆栈溢出还是在谷歌。如果我在自己的上下文中实现,那里描述的每个解决方案都会失败。目前的解决方案是:
div.container {
position: fixed;
float: left;
top: 100px;
width: 100%;
clear: both;
}
#content {
margin-right: 265px;
}
#right {
float: right;
width: 225px;
margin-left: -225px;
}
#right, #content {
height: 1%; /* fixed for IE, although doesn't seem to work */
padding: 20px;
}
<div class="container">
<div id="content">
fooburg content
</div>
<div id="right">
test right
</div>
</div>
通过上面的代码,我得到了以下结果:
|----------------------- -------|
| fooburg content | |
|-------------------------------|
| | test right |
|----------------------- -------|
请指教,非常感谢!