CSS - 绝对定位和流体 div

发布于 2024-09-29 14:49:18 字数 267 浏览 1 评论 0原文

我需要制作一个如下所示的布局:

[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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

泪冰清 2024-10-06 14:49:18

我建议阅读圣杯以获得完整的教程演练以及必要的浏览器黑客攻击和描述例如创建布局。

此外,我建议您考虑在包含元素或流体 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文