我使用自举和具有问题在图像上叠加字幕,字幕DIV只是不能配合在盒中,如下所示:引导3 CSS图象字幕叠加
HTML:
<div class="col-sm-4">
<a href="#">
<img src="images/upload/projects/21/wolf.jpg" class="img-responsive" alt="" />
<div class="desc">
<p class="desc_content">The pack, the basic unit of wolf social life.</p>
</div>
</a>
</div>
<div class="col-sm-4">
<a href="#">
<img src="images/upload/projects/21/cake.png" class="img-responsive" alt="">
<div class="desc">
<p class="desc_content">The pack, the basic unit of wolf social life.</p>
</div>
</a>
</div>
CSS:
div.desc{
position: absolute;
bottom: 0px;
width: 100%;
background-color: #000;
color: #fff;
opacity: 0.5;
filter: alpha(opacity=50);
}
SOLUTION:
由于@himanshu来解决这个问题。
div.desc{
background-color: #000;
bottom: 0;
color: #fff;
left: 0;
opacity: 0.5;
position: absolute;
width: 100%;
}
.fix{
width: 100%;
padding: 0px;
}
尝试使用盒大小:边界盒;对于p.desc_content类 – 2014-09-24 06:46:18
@Vitorino费尔南德斯,没有运气! – conmen 2014-09-24 06:48:59
尝试删除宽度:100%并添加左侧:0;右:0;对于div.desc – 2014-09-24 07:00:28