【发布时间】:2016-02-14 23:15:12
【问题描述】:
我有以下 4 个方格(两行两列):
<section id="gallery">
<div class="container-fluid">
<div class="row">
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
<div style="background-image: url(http://placehold.it/675x400)">
</div>
</div>
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
<div style="background-image: url(http://placehold.it/675x400)">
</div>
</div>
</div>
<div class="row">
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
<div style="background-image: url(http://placehold.it/675x400)">
</div>
</div>
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
<div style="background-image: url(http://placehold.it/675x400)">
</div>
</div>
</div>
</div>
</section>
我希望它们以 4 正方形的方式显示,并且网格占据页面的整个宽度和高度。我还希望它具有响应性,并且我不希望每个正方形之间有任何空格。
我尝试在我的部分标签上设置 css,如下所示:
section
{
height: 100vh;
}
但这没有任何效果。请问有人知道如何实现吗?
谢谢
【问题讨论】:
标签: html twitter-bootstrap css twitter-bootstrap-3