Here's what I'm currently seeing:
Notice that the second row isn't wrapping properly. The code looks like:
<div class="container-fluid">
<div class="row clearfix">
<div class="col-md-2 bit clearfix">
<div class="clearfix">
<div class="image-preview">
<a href=""><img src="" class="img-rounded img-responsive"/></a>
</div>
<h6><a href="">Some text</a></h6>
</div>
</div>
</div>
.... repeat ....
</div>
Any idea why the wrapping is incorrect?
OK, I figured it out. It's more of an RTFM thing with responsive column resets. You basically can use just one <div class="row">
and put all the columns in it (even if they end up appearing on different rows), as long as you put in the proper clear at the right position, e.g., <div class="clearfix visible-xs-block"></div>
. So in the below example, I'm displaying two columns on XS viewports, 6 columns on large and medium viewports, and 4 columns on small view ports.
<div class="container-fluid">
<div class="row">
{% for b in bits %}
<div class="col-xs-6 col-md-2 col-lg-2 col-sm-3 bit">
<h6><a target="_top" href="{{b.link}}">{{b.description}} </a></h6>
</div>
{% if loop.index is divisibleby 2 %}
<div class="clearfix visible-xs-block"></div>
{% endif %}
{% if loop.index is divisibleby 4 %}
<div class="clearfix visible-sm-block"></div>
{% endif %}
{% if loop.index is divisibleby 6 %}
<div class="clearfix visible-md-block"></div>
<div class="clearfix visible-lg-block"></div>
{% endif %}
{% endfor %}
</div>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With