CSS - 绝对定位和流体 div
我需要制作一个如下所示的布局:
[250px - fixed div] [fluid div, must expand depending on the width of the body and the 2 divs next/before it] [250px - fixed div]
这可能吗? 所有 3 个 div 的容器也是流动的(100% 宽度)。 所有这些 div 都包含背景图像(左 + 右 + 重复中心图像),并且应保留在后面。
I need to make a layout that looks like this:
[250px - fixed div] [fluid div, must expand depending on the width of the body and the 2 divs next/before it] [250px - fixed div]
is this possible?
the container of all 3 divs is also fluid (100% width).
all these divs contain background images (left + right + repeating center image) and should stay in the back.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我建议阅读圣杯以获得完整的教程演练以及必要的浏览器黑客攻击和描述例如创建布局。
此外,我建议您考虑在包含元素或流体 div 上放置最大宽度(例如:
#container {max-width:1024px;}
),因为在异常高的情况下分辨率/大屏幕时,拉伸的 div 可能会变得令人讨厌地大到让用户感到沮丧的程度。I suggest reading The Holy Grail for a complete tutorial walk-through and description of necessary browser hacks and such for creating the layout.
In addition, I would advise that you consider placing a max-width either on the containing element or your fluid div (for instance:
#container {max-width:1024px;}
), because on exceptionally high resolutions / large screens, a stretching div can become obnoxiously large to the point of user frustration.