【发布时间】:2021-05-05 04:58:53
【问题描述】:
我试图在 div 容器的左角顶部有一个带有数字的图标,在这个数字的右侧,图标是一个图像。在桌面上这看起来很好,并相应地分开,但在移动设备上,右侧的图像出现在左侧的图标和文本之上。
HTML 看起来像这样:
<div class="col-1">
<div class="wrap-image">
<a
th:rowNumber="${status.count}" th:href="@{'/basket/remove/' + ${product.id}}">
<img src="images/bin.png" height="60">
<span z-index: 10;>[[${status.count}]]</span>
</a>
</div>
</div>
<div class="col-3">
<img th:src="@{${product.mainImagePath}}" class="img-fluid" />
</div>
css:
.wrap-image {
position: relative;
width: min-content;
}
.wrap-image span {
position: absolute;
top: 1px;
left: 20px;
}
设备: device
电脑: desktop
如果图像和文本更多地位于角落,则可能不会发生,但主图像的大小对于移动设备也不正确,但不确定如何更改。
【问题讨论】:
标签: html css image bootstrap-4