列图像全宽响应

时间:2014-11-21 18:07:52

标签: css responsive-design row containers column-width

我正在尝试制作2张图片占据2列的全宽。我希望图像能够响应。这似乎应该很简单,但我有问题。我对将宽度应用于容器,行或使用表格感到困惑。我希望它看起来像本网站旋转木马下的前两个输入框减去动画翻转。 http://www.montere.it/?lang=en

<div class="container">
<div class="row">
<div class="col-md-6">
<div class="trans"> <img src="headertrans.jpg">
h3>The Latest</h3>
<p>From apartments and rooms to treehouses and boats: stay in unique spaces in 192 countries.</p>
<p><a href="#">See how to travel on Airbnb</a></p>
</div>     
</div>  
<div class="col-md-6">
<div class="trans"> <img src="headertrans2.jpg">
<h3>Designs</h3>
<p>Renting out your unused space could pay your bills or fund your next vacation.</p>
<p><a href="#">Learn more about hosting</a></p>
</div>
</div>

我的css:

.container {width:100%; }

。反式{     过渡:。所有0.9s轻松;

}

.trans:hover {     不透明度:0.1;

}

1 个答案:

答案 0 :(得分:0)

<强> Demo JSFiddle

由于您似乎正在使用Bootstrap,因此您需要执行类似的操作。

<强> HTML

<div class="container-fluid">
    <div class="row">
        <div class="col-xs-6 text-center box left">
            <h3>The Latest</h3>
            <p>From apartments and rooms to treehouses and boats: stay in unique spaces in 192 countries.</p>
            <p><a href="#">See how to travel on Airbnb</a>
            </p>
        </div>
        <div class="col-xs-6 text-center box right">
            <h3>Designs</h3>
            <p>Renting out your unused space could pay your bills or fund your next vacation.</p>
            <p><a href="#">Learn more about hosting</a>
            </p>
        </div>
    </div>
</div>

<强> CSS

.box{min-height:200px;}
.left{background:url("http://cdn.cutestpaw.com/wp-content/uploads/2012/07/l-Wittle-puppy-yawning.jpg"); background-size:cover}
.right{background:url("http://cdn.cutestpaw.com/wp-content/uploads/2012/07/l-Wittle-puppy-yawning.jpg"); background-size:cover}
相关问题