container.html 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. ---
  2. layout: documentation
  3. doc-tab: layout
  4. doc-subtab: container
  5. ---
  6. {% include subnav-layout.html %}
  7. <section class="section">
  8. <div class="container">
  9. <h1 class="title">Container</h1>
  10. <h2 class="subtitle">
  11. A simple <strong>container</strong> to center your content horizontally
  12. </h2>
  13. <hr>
  14. <div class="content">
  15. <p>The <code>.container</code> class can be used in any context, but mostly as a <strong>direct child</strong> of either:</p>
  16. <ul>
  17. <li><code>.header</code></li>
  18. <li><code>.hero</code></li>
  19. <li><code>.section</code></li>
  20. <li><code>.footer</code></li>
  21. </ul>
  22. <p>On <strong>mobile</strong> and <strong>tablet</strong>, the container will have a margin of <strong>20px</strong> on both the left and right sides.</p>
  23. <p>On <strong>desktop</strong> (>= 1000px), the container will have a maximum width of <strong>960px</strong> and will be <strong>horizontally centered</strong>.</p>
  24. <p>On <strong>widescreen</strong> (>= 1192px), the container will have a maximum width of <strong>1152px</strong>.</p>
  25. <p>The values <strong>960</strong> and <strong>1152</strong> have been chosen because they are divisible by both <strong>12</strong> and <strong>16</strong>.</p>
  26. </div>
  27. </div>
  28. <div class="example">
  29. <div class="container">
  30. <div class="notification">
  31. This container is <strong>centered</strong> on desktop.
  32. </div>
  33. </div>
  34. </div>
  35. {% highlight html %}
  36. <div class="container">
  37. <div class="notification">
  38. This container is <strong>centered</strong> on desktop.
  39. </div>
  40. </div>
  41. {% endhighlight %}
  42. <div class="container">
  43. <hr>
  44. <h3 class="title">Fluid container</h3>
  45. <div class="content">
  46. <p>If you don't want to have a maximum width but want to keep the 20px margin on the left and right sides, add the <code>is-fluid</code> modifier:</p>
  47. </div>
  48. </div>
  49. </section>
  50. <div class="example is-fullwidth">
  51. <div class="container is-fluid">
  52. <div class="notification">
  53. This container is <strong>fluid</strong>: it will have a 20px gap on either side.
  54. </div>
  55. </div>
  56. </div>
  57. {% highlight html %}
  58. <div class="container is-fluid">
  59. <div class="notification">
  60. This container is <strong>fluid</strong>: it will have a 20px gap on either side, on any viewport size.
  61. </div>
  62. </div>
  63. {% endhighlight %}