gpt4 book ai didi

html - 流体分区宽度

转载 作者:太空宇宙 更新时间:2023-11-04 00:22:42 25 4
gpt4 key购买 nike

<div id="post">
<img src="image.png"/>
<div class="postbox">
some content here
</div>
</div>

如何使 `.postbox' 将其宽度扩展到相对于图像宽度或没有图像的最大宽度?

#post{
width:569px;
overflow:hidden
}
#post img, #post .postbox{
float:left
}

我试过 width:100%.postbox 但它占据了整个宽度。

http://jsfiddle.net/FTY4k/

最佳答案

.postbox { width:100% }

这将使 div 与容器的宽度相同

关于html - 流体分区宽度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8392663/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com