--- title: Fixed Grid layout: docs theme: library doc-library: true doc-tab: grid breakpoints: - mobile - tablet - desktop - widescreen - fullhd breadcrumb: - home - documentation - grid - grid-fixed --- {% capture markdown %} If instead of having a minimum column width you want a **fixed** number of columns, wrap your grid in a `fixed-grid` container. By default, this fixed grid has **2 columns**: {% endcapture %} {% include markdown.html content=markdown %} {% capture fixed_count_code %}
{% for i in (1..11) %}
Cell {{ i }}
{% endfor %}
Cell 12
{% endcapture %} {% capture fixed_count %}
{% for i in (1..12) %}
Cell {{ i }}
{% endfor %}
{% endcapture %} {{ fixed_count }} {% include docs/elements/snippet.html content=fixed_count_code no_example=true more=true fullwidth=true horizontal=true %} {% include docs/elements/anchor.html name="Applying fixed grid modifiers" %} {% capture markdown %} You can change the **column count** by adding the `has-$n-cols` modifier class with a value ranging from `1` to `12`: {% endcapture %} {% include markdown.html content=markdown %} {% for i in (0..12) %} {% endfor %}
Class Column Count
has-{{ i }}-cols {{ i }}
{% include docs/elements/anchor.html name="Container breakpoints" %} {% capture markdown %} You can specify a different column count **per breakpoint**: {% endcapture %} {% include markdown.html content=markdown %} {% for i in (1..12) %} {% for bp in page.breakpoints %} {% endfor %} {% endfor %}
Column Count Mobile Tablet Desktop Widescreen Full HD
Until {{ site.data.breakpoints.mobile.to }}px From {{ site.data.breakpoints.tablet.from }}px From {{ site.data.breakpoints.desktop.from }}px From {{ site.data.breakpoints.widescreen.from }}px From {{ site.data.breakpoints.fullhd.from }}px
{{ i }}has-{{ i }}-cols-{{ bp }}
{% include docs/elements/anchor.html name="Auto Count Fixed Grid" %} {% capture markdown %} By adding the `has-auto-count` modifier, the fixed grid will **automatically** change its count for each **breakpoint**: * 2 on mobile * 4 on tablet * 8 on desktop * 12 on widescreen * 16 on fullhd {% endcapture %} {% include markdown.html content=markdown %} {% capture auto_count %}
{% for i in (1..16) %}
Cell {{ i }}
{% endfor %}
{% endcapture %} {% capture auto_count_code %}
{% for i in (1..15) %}
Cell {{ i }}
{% endfor %}
Cell 16
{% endcapture %} {{ auto_count }} {% include docs/elements/snippet.html content=auto_count_code no_example=true more=true fullwidth=true horizontal=true %}