简体   繁体   中英

column images full width responsive

I'm trying make 2 images take up full width of 2 columns. I want the images to be responsive. This seems like it should be simple but im having problems. I'm getting confused on applying width to container, row, or using table. I would like it to look like the first 2 entry boxes under the carousel on this site minus the animation rollover. 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>

my css:

.container{width: 100%; }

.trans{ transition:.all 0.9s ease;

}

.trans:hover { opacity: 0.1;

}

Demo JSFiddle

Since it seems you're using Bootstrap, you'll want to do something like this.

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}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM