如何让包含的 div 垂直拉伸以容纳浮动图像

发布于 2024-07-24 05:29:13 字数 228 浏览 0 评论 0原文

这是基本问题:

alt text http://img241.imageshack.us/img241/3800 /problemwithfloats.png

我希望保存图像的 div 垂直拉伸以容纳它。

Here's the basic problem:

alt text http://img241.imageshack.us/img241/3800/problemwithfloats.png

I want the div that holds the image to stretch vertically to accommodate it.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(2

追星践月 2024-07-31 05:29:13

将以下 CSS 格式添加到容器 div:

overflow: auto;

此外,如果您希望解决方案在 Opera 和 Windows IE 中正常工作,您似乎需要为容器 div 指定宽度

有关更多信息,请参阅 http://www.quirksmode.org/css/clearing.html信息。

史蒂夫

Add the following CSS formatting to the container div:

overflow: auto;

Also, it seems that you need to specify a width for the container div if you want the solution to work correctly in Opera and IE for Windows.

See http://www.quirksmode.org/css/clearing.html for more information.

Steve

邮友 2024-07-31 05:29:13

给div(漂亮的雾凇)溢出:隐藏

give the div (nice rime) overflow:hidden

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