2016-09-11 11:00:49 +00:00
---
2017-07-29 12:02:00 +00:00
title: Container
2016-09-11 11:00:49 +00:00
layout: documentation
2018-04-10 10:45:48 +00:00
hide_categories: true
2016-09-11 11:00:49 +00:00
doc-tab: layout
doc-subtab: container
2018-04-09 15:50:33 +00:00
breadcrumb:
- home
- documentation
- layout
- layout-container
2016-09-11 11:00:49 +00:00
---
2017-07-21 09:22:08 +00:00
{% capture container_example %}
< div class = "container" >
< div class = "notification" >
This container is < strong > centered< / strong > on desktop.
< / div >
< / div >
{% endcapture %}
{% capture container_fluid_example %}
< div class = "container is-fluid" >
< div class = "notification" >
2017-12-06 23:48:16 +00:00
This container is < strong > fluid< / strong > : it will have a 32px gap on either side, on any
viewport size.
2017-07-21 09:22:08 +00:00
< / div >
< / div >
{% endcapture %}
{% capture container_widescreen_example %}
< div class = "container is-widescreen" >
< div class = "notification" >
This container is < strong > fullwidth< / strong > < em > until< / em > the < code > $widescreen< / code > breakpoint.
< / div >
< / div >
{% endcapture %}
{% capture container_fullhd_example %}
< div class = "container is-fullhd" >
< div class = "notification" >
This container is < strong > fullwidth< / strong > < em > until< / em > the < code > $fullhd< / code > breakpoint.
< / div >
< / div >
{% endcapture %}
2018-04-09 15:15:58 +00:00
< div class = "content" >
2019-10-13 21:58:12 +00:00
< p > The < code > container< / code > class can be used in any context, but mostly as a < strong > direct child< / strong > of either:< / p >
2018-04-09 15:15:58 +00:00
< ul >
2019-10-13 21:58:12 +00:00
< li > < code > navbar< / code > < / li >
< li > < code > hero< / code > < / li >
< li > < code > section< / code > < / li >
< li > < code > footer< / code > < / li >
2018-04-09 15:15:58 +00:00
< / ul >
< p >
The containers < strong > width< / strong > for each < strong > breakpoint< / strong > is the result
of: < code > $device - (2 * $gap)< / code > . The < code > $gap< / code > variable has a default value of < code >
32px< / code > but can be modified.
< / p >
< p > This is how the container will behave:< / p >
< ul >
< li > on < code > $desktop< / code > it will have a maximum width of < strong > 960px< / strong > .< / li >
< li > on < code > $widescreen< / code > it will have a maximum width of < strong > 1152px< / strong > .< / li >
< li > on < code > $fullhd< / code > it will have a maximum width of < strong > 1344px< / strong > .< / li >
< / ul >
< p > The values < strong > 960< / strong > , < strong > 1152< / strong > and < strong > 1344< / strong > have been chosen because they are divisible by both < strong > 12< / strong > and < strong > 16< / strong > .< / p >
< / div >
2018-04-10 10:45:48 +00:00
{% include layout/main-close.html show_categories=true %}
2016-09-11 11:00:49 +00:00
2017-08-14 11:44:24 +00:00
< div class = "bd-example is-fullwidth" >
2017-07-21 09:22:08 +00:00
{{container_example}}
< / div >
2018-04-09 15:15:58 +00:00
{% include layout/main-open.html %}
2016-09-11 11:00:49 +00:00
2018-04-09 15:15:58 +00:00
{% highlight html %}{{ container_example }}{% endhighlight %}
2019-10-13 21:58:12 +00:00
{% include elements/anchor.html name="Fluid container" %}
2018-04-09 15:15:58 +00:00
< div class = "content" >
< p > If you don't want to have a maximum width but want to keep the 32px margin on the left and
right sides, add the < code > is-fluid< / code > modifier:< / p >
2016-09-11 11:00:49 +00:00
< / div >
2018-04-09 15:15:58 +00:00
{% include layout/main-close.html %}
2016-09-11 11:00:49 +00:00
2017-08-14 11:44:24 +00:00
< div class = "bd-example is-fullwidth" >
2017-07-21 09:22:08 +00:00
{{container_fluid_example}}
< / div >
2016-09-11 11:00:49 +00:00
2018-04-09 15:15:58 +00:00
{% include layout/main-open.html %}
2016-09-11 11:00:49 +00:00
2018-04-09 15:15:58 +00:00
{% highlight html %}{{ container_fluid_example }}{% endhighlight %}
2019-10-13 21:58:12 +00:00
{% include elements/anchor.html name="Breakpoint containers" %}
2018-04-09 15:15:58 +00:00
< div class = "content" >
< p >
2019-10-13 21:58:12 +00:00
With the two modifiers < code > is-widescreen< / code > and < code > is-fullhd< / code > , you can have a < em > fullwidth< / em > container < strong > until< / strong > those specific breakpoints.
2018-04-09 15:15:58 +00:00
< / p >
2016-09-11 11:00:49 +00:00
< / div >
2018-04-09 15:15:58 +00:00
{% include layout/main-close.html %}
2017-07-21 09:22:08 +00:00
2017-08-14 11:44:24 +00:00
< div class = "bd-example is-fullwidth" >
2017-07-21 09:22:08 +00:00
{{container_widescreen_example}}
< / div >
2018-04-09 15:15:58 +00:00
{% include layout/main-open.html %}
{% highlight html %}{{ container_widescreen_example }}{% endhighlight %}
{% include layout/main-close.html %}
2017-07-21 09:22:08 +00:00
2017-08-14 11:44:24 +00:00
< div class = "bd-example is-fullwidth" >
2018-04-09 15:15:58 +00:00
{{ container_fullhd_example }}
2017-07-21 09:22:08 +00:00
< / div >
2018-04-09 15:15:58 +00:00
{% include layout/main-open.html %}
{% highlight html %}{{ container_fullhd_example }}{% endhighlight %}