如何让包含的 div 垂直拉伸以容纳浮动图像
这是基本问题:
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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
将以下 CSS 格式添加到容器 div:
此外,如果您希望解决方案在 Opera 和 Windows IE 中正常工作,您似乎需要为容器 div 指定
宽度
。有关更多信息,请参阅 http://www.quirksmode.org/css/clearing.html信息。
史蒂夫
Add the following CSS formatting to the container div:
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
给div(漂亮的雾凇)溢出:隐藏
give the div (nice rime) overflow:hidden