html - 具有重叠图像的 Bootstrap

标签 html css image twitter-bootstrap

我有一个图像作为背景,我正在尝试使用 Bootstrap 中的 col- 来放置更多与背景重叠的图像,但我不能,因为重叠效果我将图像的 position 设置为 absolute,我认为这是导致问题的原因,'col-' 不起作用。这是代码:

HTML:

<img src="imag/bgimage.png" class="bg">

<div class="text-center">
<div class="col-md-3 inline-block overlap">
    <article>
        <img src="imag/image1.png">
    </article>  
</div>
<div class="col-md-3 inline-block overlap">
    <article>
        <img src="imag/image2.png">
    </article>  
</div>

CSS:
.bg {
width: 100%;
height: 100%;
opacity: 0.5;
}

.overlap {
position: absolute;
z-index: 1;
}

.inline-block {
float: none;
display: inline-block;
}

最佳答案

尝试使父容器的位置相对

关于html - 具有重叠图像的 Bootstrap,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29449787/

相关文章:

html - 如何对齐 <td rowspan ="value"> 值垂直居中?

html - 如何在 html 中将标题指向表格的第二个单元格以及如何在另一个表格旁边放置一个表格?

python - 如何在不损坏文本的情况下去除图像中的背景噪音?

jquery - fadeIn DIV 影响其他 div 值

html - 如何将图像放在另一个图像之上

jquery - 淡入正文背景图像

android - 图库应用程序如何快速加载图像和视频?

html - 星云响应式布局

javascript - 如何使用绑定(bind) :this? 获取 Svelte 组件的 html 元素

javascript - HTML Canvas 在两点之间绘制圆弧