html - Wrap an Image with transparent image without using position:absolute , top ,left ,right and bottom
问题描述
Is there a way to wrap an Image with transparent image without using position:absolute
and top , left ,bottom and right
positions ,I have tried to add div then img with transparent image url but it shows only the second image.
for example :
<style>
.Image{
width:100px;
height:100px;
border-radius: 50%;
}
</style>
<div class="Image" style="background-image:'url(./assets/Image.png)'">
<img class="Image" src="url(./assets/trans-image.png)"/>
</div>
解决方案
像这样的东西?您可能必须根据您选择的图像更改每个图像的背景位置,因为我的图像大小相同。
.overlay-image {
width: 300px;
height: 100vh;
background-image: url(https://i.ibb.co/GvXnt0J/top-img.png), url(https://i.ibb.co/VvdwhTc/bottom-img.png);
background-repeat: no-repeat;
background-position: 0 0, 0 0;
background-size: contain;
}
<div class="overlay-image"></div>
推荐阅读
- python - 按列对完整的熊猫数据框进行排序,同时保留序列顺序
- r - 在 Shiny 应用程序中更改 shinyWidget 的 switchInput 默认颜色
- elasticsearch - 在 FileBeat 上发送之前排除字段
- javascript - 如果满足条件后语句不停止
- flutter - 如何在 BottomNavigationBar Flutter 中重新加载状态 onTap
- anylogic - AnyLogic Simulation NullPointerException 在版本 8.7.2&8.7.0 上的 Descrete 事件执行期间
- docker - 我们如何使用 docker buildkit 从中间层运行?
- quicksort - 快速排序中的比较次数
- python - numpy fft中的意外幅度
- php - 如何在 XML 文档中根据子元素的值使用 PHP 删除特定元素