gpt4 book ai didi

CSS: position:absolute inside position:relative,但不影响父级?

转载 作者:行者123 更新时间:2023-11-28 12:27:23 28 4
gpt4 key购买 nike

<style>
.special p { display:none; }
.special:hover p { display:block; }
</style>

<table>
<tr>
<td style="width:200px">Things</td>
<td style="position:relative; width:220px">
<div style="position:absolute;right:0" class="special">
<img id="shows" />
<p>Variable width upto, say 600px (Will be hidden until this td is :hovered</p>
</div>
</td>
</tr>
<tr>
<td style="width:200px">Things</td>
<td style="position:relative; width:220px">
<div style="position:absolute;right:0" class="special">
<img id="shows" />
<p>Variable width upto, say 600px (Will be hidden until this td is :hovered</p>
</div>
</td>
</tr>
</table>

我可以完成这项工作吗?即,我可以使 #special p 扩展到“Things”的顶部吗?正如我目前设置的那样,#special 永远不会超出 220px 宽的 td。有什么想法吗?

最佳答案

我还不是很清楚,但试试这个。这将允许 TD 在显示内容时增长。

<table>
<tr>
<td style="width:200px">Things</td>
<td style="text-align: right;">
<div class="special">
<img id="shows" />
<p>Variable width upto, say 600px (Will be hidden until this td is :hovered</p>
</div>
</td>
</tr>
</table>

关于CSS: position:absolute inside position:relative,但不影响父级?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2588892/

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