container.html 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. ---
  2. title: Container
  3. layout: documentation
  4. doc-tab: layout
  5. doc-subtab: container
  6. ---
  7. {% capture container_example %}
  8. <div class="container">
  9. <div class="notification">
  10. This container is <strong>centered</strong> on desktop.
  11. </div>
  12. </div>
  13. {% endcapture %}
  14. {% capture container_fluid_example %}
  15. <div class="container is-fluid">
  16. <div class="notification">
  17. This container is <strong>fluid</strong>: it will have a 32px gap on either side, on any
  18. viewport size.
  19. </div>
  20. </div>
  21. {% endcapture %}
  22. {% capture container_widescreen_example %}
  23. <div class="container is-widescreen">
  24. <div class="notification">
  25. This container is <strong>fullwidth</strong> <em>until</em> the <code>$widescreen</code> breakpoint.
  26. </div>
  27. </div>
  28. {% endcapture %}
  29. {% capture container_fullhd_example %}
  30. <div class="container is-fullhd">
  31. <div class="notification">
  32. This container is <strong>fullwidth</strong> <em>until</em> the <code>$fullhd</code> breakpoint.
  33. </div>
  34. </div>
  35. {% endcapture %}
  36. {% include subnav-layout.html %}
  37. <section class="section">
  38. <div class="container">
  39. <h1 class="title">Container</h1>
  40. <h2 class="subtitle">
  41. A simple <strong>container</strong> to center your content horizontally
  42. </h2>
  43. <hr>
  44. <div class="content">
  45. <p>The <code>.container</code> class can be used in any context, but mostly as a <strong>direct child</strong> of either:</p>
  46. <ul>
  47. <li><code>.navbar</code></li>
  48. <li><code>.hero</code></li>
  49. <li><code>.section</code></li>
  50. <li><code>.footer</code></li>
  51. </ul>
  52. <p>
  53. The containers <strong>width</strong> for each <strong>breakpoint</strong> is the result
  54. of: <code>$device - (2 * $gap)</code>. The <code>$gap</code> variable has a default value of <code>
  55. 32px</code> but can be modified.
  56. </p>
  57. <p>This is how the container will behave:</p>
  58. <ul>
  59. <li>on <code>$desktop</code> it will have a maximum width of <strong>960px</strong>.</li>
  60. <li>on <code>$widescreen</code> it will have a maximum width of <strong>1152px</strong>.</li>
  61. <li>on <code>$fullhd</code> it will have a maximum width of <strong>1344px</strong>.</li>
  62. </ul>
  63. <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>
  64. </div>
  65. </div>
  66. </section>
  67. <div class="bd-example is-fullwidth">
  68. {{container_example}}
  69. </div>
  70. {% highlight html %}{{container_example}}{% endhighlight %}
  71. <section class="section">
  72. <div class="container">
  73. <h3 class="title is-4">Fluid container</h3>
  74. <div class="content">
  75. <p>If you don't want to have a maximum width but want to keep the 32px margin on the left and
  76. right sides, add the <code>is-fluid</code> modifier:</p>
  77. </div>
  78. </div>
  79. </section>
  80. <div class="bd-example is-fullwidth">
  81. {{container_fluid_example}}
  82. </div>
  83. {% highlight html %}{{container_fluid_example}}{% endhighlight %}
  84. <section class="section">
  85. <div class="container">
  86. <h3 class="title is-4">Breakpoint containers</h3>
  87. <div class="content">
  88. <p>
  89. 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.
  90. </p>
  91. </div>
  92. </div>
  93. </section>
  94. <div class="bd-example is-fullwidth">
  95. {{container_widescreen_example}}
  96. </div>
  97. {% highlight html %}{{container_widescreen_example}}{% endhighlight %}
  98. <div class="bd-example is-fullwidth">
  99. {{container_fullhd_example}}
  100. </div>
  101. {% highlight html %}{{container_fullhd_example}}{% endhighlight %}