gpt4 book ai didi

html - 如何定位 SPAN 使其与 TABLE 的任一侧和上方对齐?

转载 作者:搜寻专家 更新时间:2023-10-31 22:10:10 25 4
gpt4 key购买 nike

<div>
<span>left</span>
<span>right</span>
<!-- new line break, so no more content on that line -->
<table>
...
</table>
</div>

我如何定位这些跨度(它们可以更改为任何元素),以便根据表的大小(未在任何地方定义,也不应该定义)将跨度定位在左侧的顶部 table 和 table 的右边。

例子:

a    btable0table1table2

(其中a是左跨度,b是右跨度)

附言您可以更改除内表 html 之外的任何内容。

最佳答案

<style type="text/css">
#wrapper, #top, #tableArea
{
width: 100%;
padding: 10px;
margin: 0px auto;
}

#top
{
padding: 0px;
}

#leftBox, #rightBox
{
margin: 0px;
float: left;
display: inline;
clear: none;
}

#rightBox
{
float: right;
}
</style>
<div id="wrapper">
<div id="top">
<div id="leftBox">A</div>
<div id="rightBox">b<</div>
</div>
<div id="tableArea">
<table> ... </table>
</div>
</div>

关于html - 如何定位 SPAN 使其与 TABLE 的任一侧和上方对齐?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/228102/

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