我目前在使用Bootstrap时遇到了一个问题,涉及到一列中的HTML内容和另一列中的图像。
例如,我有以下HTML代码:
<div class="container-fluid main">
<div class="row">
<div class="col-xs-12 col-md-12 col-sm-12 col-lg-5 new-offers-text">
<h2>The new Tivoli now with half price specification upgrades</h2>
<ul>
<li>Half price upgrade from an SE to an EX model - saving <strong>£825</strong></li>
<li>Half price upgrade from an EX to an ELX – saving <strong>£700</strong></li>
</ul>
<p>Offer available until 31st October 2015 and on <strong>petrol engines</strong> only.</p>
<div class="clear spacer"></div>
<h3>Tivoli PCP</h3>
<p>SsangYong Tivoli is now available through a PCP giving you peace of mind.</p>
<p><strong>And for a limited time only, Tivoli EX petrol manuals purchased through PCP are eligible for 3 years free servicing</strong></p>
<p>With low monthly payments and SsangYong providing a Guaranteed Future Value for your vehicle you have three options on completion of your contract:</p>
<ul>
<li>Option 1 - Pay final payment & keep the car</li>
<li>Option 2 - Return the car</li>
<li>Option 3 - Trade in against a new SsangYong</li>
</ul>
<p>Talk to us about tailoring a personal quotation to meet your needs.</p>
</div>
<div class="col-xs-12 col-md-12 col-sm-12 col-lg-7">
<img src="/media/wysiwyg/porto/cmspages/ssangyong/tivoli/towing.jpg" class="manufacturer-logo">
</div>
</div>
</div>
如您所见,我在col-lg-7中有一张图片,现在的问题是当页面水平缩小时,由于内容容器变窄,会出现大面积的白色空间。这里有一个例子:http://puu.sh/kJRsm/86562deefe.jpg。您如何解决这个问题?因为在大屏幕上,布局看起来非常好,只有当容器开始变窄时,白色空间区域才会变得更大。我认为我可以通过使col-7 div成为行的100%高度,可能删除img标记,只需添加带有cover大小属性的css背景来解决这个问题,但我想知道是否还有其他方法?