我想创建一个具有 2 个遵循以下规则的水平 div 的布局:
#left
在宽度上有先例(根据内容的大小调整宽度),并#right
占据右侧的剩余宽度overflow:hidden
由于下拉菜单不使用
我创建了这个小提琴来演示这个问题:http: //jsfiddle.net/7GcRD/。它#right{overflow:hidden;}
用来展示我想要它的样子。为了显示您的解决方案有效,您需要#right{overflow:hidden;}
从示例中的 CSS 中删除。
尽管阅读了这两个资源,但我无法解决问题:
- http://colinaarts.com/articles/the-magic-of-overflow-hidden/
- http://www.w3.org/TR/CSS21/visuren.html#block-formatting
建议要么导致右侧div不占用整个宽度,要么导致右侧div 中出现滚动条。