列图像全宽响应



我正在尝试让 2 张图像占据 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:

.容器{宽度: 100%;}

.trans{ 过渡:.所有0.9s轻松;

}

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

}

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}

相关内容

  • 没有找到相关文章

最新更新