【发布时间】:2019-01-03 00:18:26
【问题描述】:
有没有办法使用img 标签在图像上添加半透明层?我也在使用引导程序并试图避免使用background-image CSS 解决方案,因为标签提供了一种快速响应填充父 div 的方法。
HTML
<div id="homebackground">
<div id="bgcont">
<b-img id="fitfill" :src="require('../assets/homebg1.jpg')" fluid-grow alt="Responsive image"/>
</div>
</div>
CSS
#bgcont{
background-color: rgba(0, 0, 0, 0.5);
}
#fitfill{
max-width: 100%;
max-height: 100%;
}
#homebackground{
height: 91.5%;
width: 100%;
margin: 0;
padding: 0;
}
【问题讨论】:
标签: html css vue.js bootstrap-4