bootstrap: 移动模式下行与行之间的空格
bootstrap: spaces between rows in mobile mode
我有一个page
我只想在移动模式下也保留行与行之间的空格。我尝试使用 visible-sm
class
添加分隔符
<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>
但这并没有帮助。我应该如何处理在移动和桌面模式下看起来相似的行?
我将边距从行移到了列。
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>
我有一个page
我只想在移动模式下也保留行与行之间的空格。我尝试使用 visible-sm
class
<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>
但这并没有帮助。我应该如何处理在移动和桌面模式下看起来相似的行?
我将边距从行移到了列。
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>