gpt4 book ai didi

html - 如何并排显示图像和表格

转载 作者:搜寻专家 更新时间:2023-10-31 08:47:27 24 4
gpt4 key购买 nike

我似乎无法将 Logo 和 table 并排放置,但彼此距离不是很近。我能够实现这一目标的唯一方法是使用表格,但图像和表格彼此非常接近。我想要页面中间的表格,以及表格和左侧屏幕远端之间的 Logo 。

像这样

标志表

现在是这样

标志

---表格

<div id="header" style="height:15%;width:100%;">
<img src="/e-com/images/logo.jpg" style="margin-left:15%;margin-top:5%"/>
<table border="1" width="44" style="margin-left:30%;float:top;">
<tr>
<td><h1><a href="home">Home</a></h1></td>
<td><h1><a href="home">Home</a></h1></td>
<td><h1><a href="home">Home</a></h1></td>
</tr>
</table>
</div>

最佳答案

使用两个div并设置为向左浮动

<div id="header" style="height:15%;width:100%;">
<div style='float:left'>
<img src="/e-com/images/logo.jpg" style="margin-left:15%;margin-top:5%"/>
</div>
<div style='float:leftt'>
<table border="1" width="44" style="margin-left:30%;float:top;">
<tr>
<td><h1><a href="home">Home</a></h1></td>
<td><h1><a href="home">Home</a></h1></td>
<td><h1><a href="home">Home</a></h1></td>
</tr>
</table>
</div>
</div>

关于html - 如何并排显示图像和表格,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14816664/

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