gpt4 book ai didi

css - 列图像全宽响应

转载 作者:行者123 更新时间:2023-11-28 08:57:42 25 4
gpt4 key购买 nike

我正在尝试让 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:

.container{宽度:100%;

.trans{ transition:.all 0.9s 缓和;

.trans:悬停{ 不透明度: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}

关于css - 列图像全宽响应,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27067622/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com