这是这个问题的一张图片,当调整文本区域的大小时,其他表格文本元素覆盖了文本区域。我想要它,这样当你调整文本区域的大小时,它会将文本隐藏在它后面,这样你就可以自由地输入和查看文本区域中的所有内容。
编辑:位置:绝对覆盖了文本,但现在较低行的文本区对象阻碍了link (不要对链接图像投下赞成票,stackoverflow不允许我发布图片,因为我的排名不够高)
发布于 2017-06-28 03:54:56
我会使用position: absolute
并将其包装在position: relative
容器中。
table {width: 100%;}
td {width: 33%;}
.wrap {position: relative; height: 100px; z-index: 2;}
.wrap textarea {position: absolute; height: 95px; width: 95%; z-index: 2;}
.wrap textarea:focus {z-index: 99;}
<table>
<thead>
<tr>
<th>Column 1</th>
<th>Column 2</th>
<th>Column 3</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<div class="wrap"><textarea name="" id="" cols="30" rows="10"></textarea></div>
</td>
<td>
Hello World
</td>
<td>
Hello World
</td>
</tr>
<tr>
<td>
<div class="wrap"><textarea name="" id="" cols="30" rows="10"></textarea></div>
</td>
<td>
Hello World
</td>
<td>
Hello World
</td>
</tr>
</tbody>
</table>
https://stackoverflow.com/questions/44788702
复制相似问题