gpt4 book ai didi

html - 强制一个元素低于另一个元素?

转载 作者:太空狗 更新时间:2023-10-29 13:55:37 29 4
gpt4 key购买 nike

我的基本布局是这样的:

<table>
...
</table>
<table>
...
</table> // There's actually five tables, but that's irrelevant
<img .../>
</body>

我正在尝试将图像制作成页脚,在所有表格下方,但我能做到的最好的办法是它卡在表格的右侧(我的屏幕很大,所以它可能会环绕在表格下方表格适合你,但不适合我)或者我可以通过使用 position:absolute 让它漂浮在表格的正上方。我这辈子都无法将图像强行包裹在 table 下面。

我曾尝试将图像包装在一个 div 中,并将各种属性/特性的组合添加到该 div,但正如我所说,它们都会产生上面列出的两种不良结果之一。

谁能提供某种解决方案?

我见过一些其他的 SO 问题,例如 How to force div to appear below not next to another? ,但我根本不理解该解决方案(float:left 如何强制某些东西低于其他东西?)而且我也不相信该解决方案需要额外的包装器 <div> .

最佳答案

<div>
<table>
...
</table>
<table>
...
</table>

</div>
<div style="clear:both;">
<img .../>
</div>

</body>

或使用CSS。并为 img 或 div 标签创建样式。

关于html - 强制一个元素低于另一个元素?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11764743/

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