Unfortunately, it does not seem to be a good way to control the vertical spacing between columns that go from the horizontal stack to the vertical stack at certain breakpoints. There seems to be a solution when the form is involved , but that is not the point. I tried this solution , but it does not work when multiple columns are wrapped in a row.
To illustrate my scenario, here is the structure of my HTML:
<body> <div class="container"> <div class="row"> <div class="col-md-4"> col 1 </div> <div class="col-md-4"> col 2 </div> <div class="col-md-4"> col 3 </div> <div class="col-md-4"> col 4 </div> <div class="col-md-4"> col 5 </div> <div class="col-md-4"> col 6 </div> </div> </div> </body>
https://jsfiddle.net/b74a3kbs/6/
With average device sizes (md) and higher, I would like for there to be an interval between the two “rows” of columns, but there would be no “second row” of columns between the “first row” of 3 columns. 3 columns. When the columns are vertically below the average device size (md), I would like to have a spacing between each of the columns, but none should be above the first child and not one below the last child.
Ideally, the solution will work regardless of how many columns (e.g. 3, 5, 6, 12) are contained in the row.
html5 css3 twitter-bootstrap-4 bootstrap-4 spacing
keruilin Apr 04 '17 at 13:08 on 2017-04-04 13:08
source share