我的要求很简单:2列,右列有固定大小.不幸的是,我无法在stackoverflow和Google上找到有效的解决方案.如果我在自己的上下文中实现,那么每个解决方案都会失败 目前的解决方案是:
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;
}
Run Code Online (Sandbox Code Playgroud)
<div class="container">
<div id="content">
fooburg content
</div>
<div id="right">
test right
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
我用上面的代码得到以下内容:
|----------------------- -------|
| fooburg content | |
|-------------------------------|
| | test right |
|----------------------- -------|
Run Code Online (Sandbox Code Playgroud)
请指教.非常感谢!