【发布时间】:2019-09-10 14:28:54
【问题描述】:
我想放置一个覆盖图像的文本。以下是我目前使用的代码:
<td width="10%">
<img src="tempballoon.png" alt="balloon" style="z-index: -1" />
<div style="position:relative;left:30px;top:-75px;font-size: 32px;display: none">
Test
</div>
</td>
我的问题是,虽然文本被正确覆盖,但它在<td> 中消耗的“空间”仍然存在!当我尝试用“margin-top”替换<div> 中的“顶部”位置时,它也会影响<img>,因此<img> 越过了<td> 的边界。
【问题讨论】:
标签: html css image css-position overlay