我在 html 表格中有一个图像列表,需要在每个图像上重叠一个小图标。我们如何使用 z 索引和定位来做到这一点?
最佳答案
.under {
position: absolute;
left: 0px;
top: 0px;
z-index: -1;
}
.over {
position: absolute;
left: 40px;
top: 10px;
z-index: -1;
}
<img src="https://tafttest.com/184x46.png" width="184" height="46" class="under" />
<img src="https://tafttest.com/100x84.png" width="100" height="84" class="over" />
关于html - 我们如何使用 css 样式重叠两个图像?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1782601/