我有一个page
我只想在移动模式下在行之间保持空格。我尝试使用visible-sm
类添加分隔符
<div class="row">
<div class="col-xs-6 col-sm-6 col-md-3">
Block #11
</div>
<div class="col-xs-6 col-sm-6 col-md-3">
Block #12
</div>
<div class="w-100 visible-sm row-divider"></div>
<div class="col-xs-6 col-sm-6 col-md-3">
Block #13
</div>
<div class="col-xs-6 col-sm-6 col-md-3">
Block #14
</div>
</div>
但没有帮助。在移动模式和台式机模式下,行应该看起来相似吗?
答案 0 :(得分:1)
我将页边距从行移动到了col。
http://jsfiddle.net/aq9Laaew/147947/
h3{
margin-bottom:-20px;
}
div[class^='col'] {
background: #f8f9fa;
margin-top: 40px;
}
.col {
border: solid 1px #6c757d;
padding: 10px;
}
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" crossorigin="anonymous"></script>
<div class="container">
<h3>Block #1</h3>
<div class="row">
<div class="col-xs-6 col-sm-6 col-md-3">
Block #11
</div>
<div class="col-xs-6 col-sm-6 col-md-3">
Block #12
</div>
<div class="col-xs-6 col-sm-6 col-md-3">
Block #13
</div>
<div class="col-xs-6 col-sm-6 col-md-3">
Block #14
</div>
</div>
<div class="row row-divider">
<div class="col-xs-6 col-sm-6 col-md-3">
Block #21
</div>
<div class="col-xs-6 col-sm-6 col-md-3">
Block #22
</div>
<div class="col-xs-6 col-sm-6 col-md-3">
Block #23
</div>
<div class="col-xs-6 col-sm-6 col-md-3">
Block #24
</div>
</div>
<div class="row row-divider">
<div class="col-xs-6 col-sm-6 col-md-3">
Block #31
</div>
<div class="col-xs-6 col-sm-6 col-md-3">
Block #32
</div>
<div class="col-xs-6 col-sm-6 col-md-3">
Block #33
</div>
</div>
</div>