gpt4 book ai didi

html - 在居中表格旁边放置图像

转载 作者:行者123 更新时间:2023-11-28 03:15:36 24 4
gpt4 key购买 nike

这可能是一个“重新洗过”的问题,但我很难将图像放在已居中的表格旁边,下面的代码是我坚持使用的代码段。

<img src="FS.png" class="abcdef" width="124" height="166" style="float:right;position: relative"/>
<div align="center">

<table width="576" border="1">
<tr>
<td width="348">&nbsp;</td>
<td width="212">&nbsp;</td>

</tr>
<tr>

<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>

<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>

<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>

<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>

<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>

<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>

<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>

<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</table>
</div>
</div>

图像被放置在屏幕的最右侧,表格居中,我需要将图像放置在表格的中心旁边。

最佳答案

div#tab{width:580px; float:left;}
div#pix{width:150px; float:right;}

body{width:730px;
margin:0 auto;}
<body>
<div id="tab">

<table width="576" border="1">
<tr>
<td width="348">&nbsp;</td>
<td width="212">&nbsp;</td>

</tr>
<tr>

<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>

<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>

<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>

<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>

<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>

<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>

<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>

<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</table>
</div>
<div id="pix">
<img src="FS.png" class="abcdef" width="124" height="166" float="right" position="relative"/>
</div>
</body>

关于html - 在居中表格旁边放置图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28161123/

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