我试图创建一个尺寸为900x420的3幅图像的横幅,如底部的图片。林想知道如何让他们对齐,每个图像以某种方式水平居中。任何建议,将不胜感激: a busy cat http://i62.tinypic.com/208u0is.png覆盖和中心图像css
到目前为止,我有这个与Twitter的引导:
<div class="container-fluid">
<div class="img-holder">
<img src="img/rm1.jpg" alt="" />
<div class="caption">
<h3 class="title-content">Caption goes here<h3>
</div>
</div>
<div class="img-holder">
<img src="img/rm2.jpg" alt="" />
<div class="caption">
<h3 class="title-content">Caption goes here<h3>
</div>
</div>
<div class="img-holder">
<img src="img/rm3.jpg" alt="" />
<div class="caption">
<h3 class="title-content">Caption goes here<h3>
</div>
</div>
</div>
CSS:
.img-holder {
float: left;
position: relative;
background - color: rgba(2, 85, 165, 0.36);
}
.img-holder.caption {
display: inline - block;
position: absolute; /* absolute position (so we can position it where we want)*/
bottom: 0 px; /* position will be on bottom */
left: 0 px;
right: 0 px;
width: 100 % ;
/* styling bellow */
background - color: rgba(0, 0, 0, 0.76);
color: white;
}
h3.title_content {
padding: 10 px;
margin: 0 px;
}
嗯,这是安静的关闭,但正如你所看到的图像叠加在某种程度上,我不认为你需要指定一个容器的宽度。你可以看到每个图像都是900x420,它们覆盖的方式有什么变化 – 2014-10-27 21:48:13
你是说你想让标题位于图像的中心吗? – Sai 2014-10-27 21:50:32
号码字幕在这里没有任何事情要做。你在你的例子中做过的同样的事情,图片尺寸为900x420,而不是450x210,需要将所有图片以某种方式叠加在一起,才能正确修复 – 2014-10-27 21:55:42