html - 如何在引导程序中将卡放在图像上?
问题描述
我现在正在做一个网站。我尝试了几次将卡片放在图片上。你有什么建议吗? https://i.stack.imgur.com/goigA.png
解决方案
一种方式设置为负margin-top
,例如:margin-top : -100px
.tag {
position: relative;
left: 0px;
background-color: green;
z-index: 1000;
margin-top: -50px;
width: 100px;
height: 100px;
margin-right: 20px;
}
.d-flex{
display: flex;
}
<div class="container">
<img src="https://homepages.cae.wisc.edu/~ece533/images/arctichare.png">
<div class="d-flex">
<div class="tag">Featured</div>
<div class="tag">Featured</div>
<div class="tag">Featured</div>
<div class="tag">Featured</div>
</div>
</div>
推荐阅读
- grid - TailwindCSS:如何在网格中从右侧添加元素?
- authentication - 成功登录后,我想重定向到我登录前的屏幕。getLoginRedirect() 不起作用
- c++ - 在 CPP 控制台中打印彩色 ascii 艺术
- javascript - 根据所选的下拉城市显示 google 地方自动完成
- java - 为什么我的最后一个索引不应该有一个值?
- python - 当真正的循环不起作用时在里面增加
- c# - 垂直点的坐标
- json - 在 Nifi 中转换/舍入十进制数
- arrays - C程序使用2个数组计算数字中的每个数字
- oracle - 在 WSL2 中使用 docker 构建 Go + go-oci8 时出错