CSS - 如何制作 100% 高度的 2 列布局,标题高度未知
我需要完成主题,但确实陷入了困境。为了更好地描述,我放了一张我需要得到的图片:
首先,我'我尝试使用 div
来实现,但由于 width
属性,它在 Firefox 中看起来完全不同。虽然我主要关心的是 IE8 非标准模式(这是要求),但我希望它在 Firefox 中看起来或多或少像样。
然后我尝试用两列表格来做,它在 IE 中运行良好,在 Firefox 中也运行良好,但由于某种原因,如果右列内容变得比屏幕宽,表格将无法容纳,并且我的内容会被水平裁剪表,不显示滚动条。
另外,查看了 Stackoverflow 上的早期帖子,使用 fixed
容器,但它似乎无法在 IE8 非标准模式下工作。
我们很高兴听到任何关于如何做到这一点的想法。
I need to achieve subject, and really got stuck. To better describe, I've put up a picture of what I need to get:
At first I've tried to do it with div
s, but it looks completely different in Firefox due to width
attribute. Although my primary concern is IE8 non-standard mode (that's requirement), I wanted it to look more or less decent in Firefox.
Then I tried to do it with two-column table, and it works well in IE and somewhat well in Firefox, but for some reason if the right column content gets wider than screen, table does not accomodate and my content is cropped horizontally by the table, no scrollbar is shown.
Also, looked at the earlier posts on Stackoverflow, with fixed
container, but it doesn't seem to work in IE8 non-standard mode.
Would be glad to hear any ideas on how this could be done.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
也许你可以这样做:
检查这个 http://jsfiddle.net/QHTeS/
May be you can do like this:
Check this http://jsfiddle.net/QHTeS/
这应该有帮助 - 一个非常基本的例子。
http://jsfiddle.net/pRAgY/
知道宽度后记得调整右侧容器的宽度,因为 6px 边框(总共 24px)超过了 100% 可用宽度。
This should help - a very basic example.
http://jsfiddle.net/pRAgY/
Remember to adjust the width of the right container when you know the width, as the 6px border (totalling 24px) goes over the 100% width avalible.